Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL-related tests fail on JDK 11 #22

Open
mike10004 opened this issue Aug 13, 2019 · 0 comments
Open

SSL-related tests fail on JDK 11 #22

mike10004 opened this issue Aug 13, 2019 · 0 comments

Comments

@mike10004
Copy link

Tests that make SSL connections fail due to errors when building with JDK 11. Specifically, these tests exhibit errors:

testConnectNoAuthSSLServer(sockslib.test.client.TestSSLSocks5): Connection reset
testConnectSSLAuthServer(sockslib.test.client.TestSSLSocks5): Connection reset
testSSLConnect(sockslib.test.quickstart.TestSocks5Server): Connection reset
testSSL2Connect(sockslib.test.quickstart.TestSocks5Server): Connection reset
tesSslUDP(sockslib.test.quickstart.TestSocks5Server): Received fatal alert: handshake_failure

This can be reproduced by building in containers. The tests pass when, in a local cloned repository directory, you execute

$ docker run -it --rm -v $PWD:/usr/src/sockslib -w /usr/src/sockslib maven:3.6-jdk-8 mvn clean install

...which builds with JDK 8, but they fail if you execute

$ docker run -it --rm -v $PWD:/usr/src/sockslib -w /usr/src/sockslib maven:3.6-jdk-11 mvn clean install

...which builds with JDK 11.

Partial build log showing the failures on JDK 11 is attached:
sockslib-build-jdk-11.log

Java version details are:

openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment 18.9 (build 11.0.4+11)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.4+11, mixed mode)

A workaround is to set the system property jdk.tls.client.protocols=TLSv1.2 as mentioned here. (This was revealed to me in a comment on this question.) That is, change the Maven command to

$ mvn clean install -Djdk.tls.client.protocols=TLSv1.2

However, because it seems that JDK 11 is defaulting to TLSv1.3, some change to the SSLConfiguration.getSSLSocketFactory() method is probably approprate. I do not know what that change is, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant