Skip to content

Commit

Permalink
Merge pull request #5947 from mtbc/client-SSL
Browse files Browse the repository at this point in the history
have Java clients remove "anon" from disabled algorithms
  • Loading branch information
sbesson committed Jan 24, 2019
2 parents 6bed02c + c3d8ba7 commit cad1883
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions components/blitz/src/omero/client.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.io.IOException;
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 @@ -69,6 +70,11 @@
import Glacier2.SessionNotExistException;
import Ice.Current;

import com.google.common.base.Joiner;
import com.google.common.base.Splitter;

import org.apache.commons.lang.StringUtils;

/**
* Central client-side blitz entry point. This class uses solely Ice
* functionality to provide access to blitz (as opposed to also using Spring)
Expand Down Expand Up @@ -397,6 +403,24 @@ private void init(Ice.InitializationData id) {
}
}

// Ensure that anonymous cipher suites are enabled in JRE
final String property = "jdk.tls.disabledAlgorithms";
final String value = Security.getProperty(property);
if (StringUtils.isNotBlank(value)) {
final List<String> algorithms = new ArrayList<>();
boolean isChanged = false;
for (final String algorithm : Splitter.on(',').trimResults().split(value)) {
if ("anon".equals(algorithm.toLowerCase())) {
isChanged = true;
} else {
algorithms.add(algorithm);
}
}
if (isChanged) {
Security.setProperty(property, Joiner.on(", ").join(algorithms));
}
}

if (__ic != null) {
throw new ClientError("Client already initialized.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def testStringCol(self):
#
# ROIs
#
@pytest.mark.broken
def testMaskColumn(self):
hdf = HdfStorage(self.hdfpath(), self.lock)
mask = omero.columns.MaskColumnI('mask', 'desc', None)
Expand Down
11 changes: 11 additions & 0 deletions history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
OMERO version history
=====================

5.4.10 (January 2019)
---------------------

This release addresses a login issue for Java clients such as Insight
and ``bin/omero import``. New releases of Java include a change to the
``java.security`` file that disables anonymous cipher suites. This
change causes ``SSLHandshakeException`` when the client attempts to
authenticate to OMERO.blitz. The OMERO 5.4.10 release has clients check
the security property ``jdk.tls.disabledAlgorithms`` for the value
"anon" and remove it if present thus allowing authentication to proceed.

5.4.9 (October 2018)
--------------------

Expand Down

0 comments on commit cad1883

Please sign in to comment.