JDK-8164591 : sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-08-23
  • Updated: 2016-10-07
  • Resolved: 2016-09-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b139Fixed
Related Reports
Duplicate :  
Relates :  
Description
sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed intermittently with javax.net.ssl.SSLHandshakeException:

Please refer to the test output:

----------System.out:(2/197)----------
Testing /Users/aurora/sandbox/testbase/jdk/test/sun/net/www/protocol/https/HttpsClient/.//dnsstore
Testing /Users/aurora/sandbox/testbase/jdk/test/sun/net/www/protocol/https/HttpsClient/.//ipstore
----------System.err:(30/2084)----------
javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1022)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:949)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1356)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1383)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1367)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1508)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:235)
	at ServerIdentityTest.doClientSide(ServerIdentityTest.java:129)
	at ServerIdentityTest.startClient(ServerIdentityTest.java:272)
	at ServerIdentityTest.<init>(ServerIdentityTest.java:202)
	at ServerIdentityTest.main(ServerIdentityTest.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:504)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
	at java.lang.Thread.run(Thread.java:746)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
	at sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:156)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:995)
	... 19 more
Comments
Code review: http://mail.openjdk.java.net/pipermail/security-dev/2016-September/014797.html
07-09-2016

I couldn't reproduce it by running the test in a loop on Linux x64. It's not quite clear why it failed, enabling debug output may help if it fails next time. While looking at the test, I notices a couple of issues, but they don't seem to cause these intermittent failures: - The test sets system properties for JSSE in a loop, but JSSE provider reads them only once while initialization. As a result, only values which were set in the first iteration are actually used. - The test doesn't close resources sometimes. I would suggest to enable debug output for this test, and fix the issues above.
07-09-2016