JDK-8262409 : sun/security/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions. SSL test failures caused by java failed with "Server reported the wrong exception"
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2021-02-25
  • Updated: 2021-10-22
  • Resolved: 2021-06-03
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 11 JDK 17 JDK 8
11.0.13Fixed 17 b26Fixed 8u321Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8264656 :  
JDK-8265890 :  
Description
The following test failed in the JDK17 CI:

sun/security/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions.java

Here's a snippet from the log file:

#section:main
----------messages:(4/198)----------
command: main SSLSocketImplThrowsWrongExceptions
reason: User specified action: run main/othervm SSLSocketImplThrowsWrongExceptions 
Mode: othervm [/othervm specified]
elapsed time (seconds): 0.392
----------configuration:(0/0)----------
----------System.out:(10/440)----------
starting Server
    Client starting
got server socket
Server socket accepting...
        Client creating socket
Server starting handshake
        Client starting handshake
       Client reported correct exception
       javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Server reported the wrong exception
----------System.err:(31/2280)----------
Server died...
java.net.SocketException: Broken pipe
	at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:420)
	at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
	at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826)
	at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1031)
	at java.base/sun.security.ssl.SSLSocketOutputRecord.flush(SSLSocketOutputRecord.java:266)
	at java.base/sun.security.ssl.HandshakeOutStream.flush(HandshakeOutStream.java:89)
	at java.base/sun.security.ssl.Finished$T13FinishedProducer.onProduceFinished(Finished.java:787)
	at java.base/sun.security.ssl.Finished$T13FinishedProducer.produce(Finished.java:675)
	at java.base/sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:440)
	at java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.goServerHello(ClientHello.java:1252)
	at java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.consume(ClientHello.java:1188)
	at java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.onClientHello(ClientHello.java:851)
	at java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.consume(ClientHello.java:812)
	at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458)
	at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:199)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1501)
	at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1415)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:450)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:421)
	at SSLSocketImplThrowsWrongExceptions.doServerSide(SSLSocketImplThrowsWrongExceptions.java:96)
	at SSLSocketImplThrowsWrongExceptions$1.run(SSLSocketImplThrowsWrongExceptions.java:266)

JavaTest Message: Test threw exception: java.net.SocketException: Broken pipe
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.net.SocketException: Broken pipe
----------rerun:(36/5839)*----------
Comments
Fix request (11u): Request for backporting this testfix to JDK11u. After JDK-8259662 was backported we run into this test issue intermittently. Testfix applied clean, problem list entry did not exist in 11 though.
01-07-2021

Changeset: 3aa7062c Author: Fernando Guallini <fguallini@openjdk.org> Committer: Rajan Halade <rhalade@openjdk.org> Date: 2021-06-03 16:06:31 +0000 URL: https://git.openjdk.java.net/jdk/commit/3aa7062c3dd41e06df67b46473ee2ef5a9671cf9
03-06-2021

As mentioned above, this test failure is related to JDK-8259662.
02-06-2021

The exception mentioned here seems to be related to JDK-8259516.
23-03-2021

This would require a larger effort to evaluate all these tests so I will file a separate bug and create tasks from it to address.
25-02-2021

Tests from following groups should be evaluated: sun/security/ssl sun/security/util sun/net/www/protocol/https javax/net/ssl java/net/httpclient com/sun/jndi/ldap/LdapCBPropertiesTest.java
25-02-2021

This test failure looks to be related JDK-8259662. We should run these ssl tests in a loop to find intermittent failures.
25-02-2021