JDK-8271560 : sun/security/ssl/DHKeyExchange/LegacyDHEKeyExchange.java still fails due to "An established connection was aborted by the software in your host machine"
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2021-07-30
  • Updated: 2021-09-20
  • Resolved: 2021-08-30
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 18
11.0.14-oracleFixed 17.0.2Fixed 18 b13Fixed
Related Reports
Relates :  
Description
The following test failed in the JDK17 CI:

sun/security/ssl/DHKeyExchange/LegacyDHEKeyExchange.java


Here's a snippet from the log file:

#section:main
----------messages:(4/246)----------
command: main -Djdk.tls.ephemeralDHKeySize=legacy LegacyDHEKeyExchange
reason: User specified action: run main/othervm -Djdk.tls.ephemeralDHKeySize=legacy LegacyDHEKeyExchange 
Mode: othervm [/othervm specified]
elapsed time (seconds): 0.813
----------configuration:(0/0)----------
----------System.out:(30/2358)----------
Expected exception thrown in client
Server failed: java.net.SocketException: An established connection was aborted by the software in your host machine
java.net.SocketException: An established connection was aborted by the software in your host machine
	at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:325)
	at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350)
	at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803)
	at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
	at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
	at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
	at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1500)
	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.ensureNegotiated(SSLSocketImpl.java:915)
	at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1006)
	at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:966)
	at SSLSocketTemplate.runServerApplication(SSLSocketTemplate.java:94)
	at LegacyDHEKeyExchange.runServerApplication(LegacyDHEKeyExchange.java:48)
	at SSLSocketTemplate.doServerSide(SSLSocketTemplate.java:280)
	at SSLSocketTemplate.startServer(SSLSocketTemplate.java:584)
	at SSLSocketTemplate.bootup(SSLSocketTemplate.java:498)
	at SSLSocketTemplate.run(SSLSocketTemplate.java:83)
	at LegacyDHEKeyExchange.main(LegacyDHEKeyExchange.java:85)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:833)
----------System.err:(33/2528)----------
java.net.SocketException: An established connection was aborted by the software in your host machine
	at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:325)
	at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350)
	at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803)
	at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
	at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
	at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
	at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1500)
	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.ensureNegotiated(SSLSocketImpl.java:915)
	at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1006)
	at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:966)
	at SSLSocketTemplate.runServerApplication(SSLSocketTemplate.java:94)
	at LegacyDHEKeyExchange.runServerApplication(LegacyDHEKeyExchange.java:48)
	at SSLSocketTemplate.doServerSide(SSLSocketTemplate.java:280)
	at SSLSocketTemplate.startServer(SSLSocketTemplate.java:584)
	at SSLSocketTemplate.bootup(SSLSocketTemplate.java:498)
	at SSLSocketTemplate.run(SSLSocketTemplate.java:83)
	at LegacyDHEKeyExchange.main(LegacyDHEKeyExchange.java:85)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:833)

JavaTest Message: Test threw exception: java.net.SocketException: An established connection was aborted by the software in your host machine
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.net.SocketException: An established connection was aborted by the software in your host machine
----------rerun:(41/5554)*----------


This failure message was previously seen in the follow bug,
but with a different stack trace:

JDK-8228442 DHKeyExchange/LegacyDHEKeyExchange.java failed due to "SSLException: An established connection was aborted by the software in your host machine"

Since this is a Tier2 failure, I'm starting this bug off as a P3.
Comments
Fix Request (11u): Should get backported for parity with 11.0.14-oracle. Applies cleanly.
17-09-2021

Changeset: f18c0fac Author: Fernando Guallini <fguallini@openjdk.org> Committer: Rajan Halade <rhalade@openjdk.org> Date: 2021-08-30 17:28:49 +0000 URL: https://git.openjdk.java.net/jdk/commit/f18c0fac11aac833edfdc484e221518c55daa9a7
30-08-2021

Ran the test many thousands of times and got a few sporadic failures. The only way to fully stabilize it seems to be by catching and expecting both the SocketException and SSLException in the test, which is not ideal but it will help removing noise
03-08-2021

[~fguallini] Assigning this to you based on the related issue that you recently fixed to see if there is a connection - can you please look into this one? Thanks.
02-08-2021