Skip to content

Commit

Permalink
Revert "Java client init: no "anon" among jdk.tls.disabledAlgorithms"
Browse files Browse the repository at this point in the history
This reverts commit a9a5a85.
  • Loading branch information
sbesson committed Aug 23, 2023
1 parent 0c31bf7 commit 25e2115
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions src/main/java/omero/client.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.security.Security;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -200,42 +199,6 @@ public void run() {
// Creation
// =========================================================================

/**
* Ensure that anonymous cipher suites are enabled in the JRE.
*/
static {
final String property = "jdk.tls.disabledAlgorithms";
final String value = Security.getProperty(property);
if (!(value == null || value.trim().isEmpty())) {
final List<String> algorithms = new ArrayList<>();
boolean isChanged = false;
for (String algorithm : value.split(",")) {
algorithm = algorithm.trim();
final String algorithmLower = algorithm.toLowerCase();
if (algorithm.isEmpty()) {
/* ignore */
} else if (algorithmLower.equals("anon") || algorithmLower.endsWith("_anon")) {
isChanged = true;
} else {
algorithms.add(algorithm);
}
}
if (isChanged) {
boolean needsComma = false;
final StringBuilder newValue = new StringBuilder();
for (final String algorithm : algorithms) {
if (needsComma) {
newValue.append(", ");
} else {
needsComma = true;
}
newValue.append(algorithm);
}
Security.setProperty(property, newValue.toString());
}
}
}

private static Properties defaultRouter(String host, int port) {
Properties p = new Properties();
p.setProperty("omero.host", host);
Expand Down

0 comments on commit 25e2115

Please sign in to comment.