JDK-8205014 : com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java failed with "Read timed out"
  • Type: Bug
  • Component: security-libs
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-05-06
  • Updated: 2021-05-03
  • Resolved: 2018-06-25
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 Other
11Fixed openjdk8u302Fixed
Related Reports
Relates :  
Relates :  
Description
java.lang.RuntimeException: Test failed
	at DeadServerTimeoutSSLTest.fail(DeadSSLLdapTimeoutTest.java:94)
	at DeadServerTimeoutSSLTest.handleNamingException(DeadSSLLdapTimeoutTest.java:81)
	at DeadServerTimeoutSSLTest.call(DeadSSLLdapTimeoutTest.java:127)
	at DeadSSLLdapTimeoutTest.main(DeadSSLLdapTimeoutTest.java:201)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: javax.naming.CommunicationException: localhost:12092 [Root exception is javax.net.ssl.SSLException: Read timed out]
	at java.naming/com.sun.jndi.ldap.Connection.<init>(Connection.java:223)
	at java.naming/com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137)
	at java.naming/com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1616)
	at java.naming/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2752)
	at java.naming/com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:320)
	at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192)
	at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210)
	at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153)
	at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83)
	at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730)
	at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
	at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
	at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208)
	at java.naming/javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
	at DeadServerTimeoutSSLTest.call(DeadSSLLdapTimeoutTest.java:120)
	... 7 more
Caused by: javax.net.ssl.SSLException: Read timed out
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:124)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:316)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:259)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:254)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:133)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:851)
	at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:796)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:387)
	at java.naming/com.sun.jndi.ldap.Connection.createSocket(Connection.java:329)
	at java.naming/com.sun.jndi.ldap.Connection.<init>(Connection.java:202)
	... 21 more
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.base/java.net.SocketInputStream.socketRead0(Native Method)
	at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:171)
	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:141)
	at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:473)
	at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:107)
	... 26 more

Comments
Note that for later JDKs the fix was part of JDK-8196584 (TLS 1.3 implementation). JDK-8141370 is the bug previously referenced in ProblemList.
27-04-2021

This was apparently missing from 8u TLS 1.3 implementation. I'll backport this to 8u.
27-04-2021

Fix Request (8u) This fixes the SSL-related test after TLS 1.3 backport to 8u. 8u RFR (acked by sgehwolf): https://mail.openjdk.java.net/pipermail/jdk8u-dev/2021-April/013731.html
27-04-2021

The changeset has been pushed by JDK-8196584
26-06-2018

Just pushed to sandbox http://hg.openjdk.java.net/jdk/sandbox/rev/85305a50b1b4
21-06-2018

If this exception hierarchy is also expected, the below patch may fix it diff -r 6210466cf1ac test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java --- a/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java Tue Jun 19 15:53:35 2018 -0700 +++ b/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java Wed Jun 20 20:56:31 2018 +0800 @@ -67,7 +67,8 @@ public void performOp(InitialContext ctx) throws NamingException {} public void handleNamingException(NamingException e, long start, long end) { - if (e.getCause().getCause() instanceof SocketTimeoutException) { + if (e.getCause() instanceof SocketTimeoutException + || e.getCause().getCause() instanceof SocketTimeoutException) { // SSL connect will timeout via readReply using // SocketTimeoutException e.printStackTrace();
20-06-2018

It looks it only failed on solaris-sparcv9.
20-06-2018

Failed on June 13th http://java.se.oracle.com:10060/api/v1/results/4fcc2543-297f-4e29-9beb-62ef8e80d9ea/log
14-06-2018

No such failure is found in recent 3 Mach5 runs.
07-06-2018

Maybe the two exception hierarchies should be supported
30-05-2018

It looks the product goes back to the original exception hierarchy on this point. But strangely, this failure is on Solaris only . http://java.se.oracle.com:10060/api/v1/results/8b947e10-4a3f-40d6-99cd-563e33725844/log ======================================== Running connect timeout test with 10ms connect timeout, 3000ms read timeout & SSL [] [] class DeadServerTimeoutSSLTest - elapsed: 2137 ----------System.err:(41/2835)---------- java.lang.RuntimeException: Test failed at DeadServerTimeoutSSLTest.fail(DeadSSLLdapTimeoutTest.java:94) at DeadServerTimeoutSSLTest.handleNamingException(DeadSSLLdapTimeoutTest.java:81) at DeadServerTimeoutSSLTest.call(DeadSSLLdapTimeoutTest.java:127) at DeadSSLLdapTimeoutTest.main(DeadSSLLdapTimeoutTest.java:201) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115) at java.base/java.lang.Thread.run(Thread.java:832) Caused by: javax.naming.CommunicationException: localhost:65430 [Root exception is java.net.SocketTimeoutException] at java.naming/com.sun.jndi.ldap.Connection.<init>(Connection.java:223) at java.naming/com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137) at java.naming/com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1616) at java.naming/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2752) at java.naming/com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:320) at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192) at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210) at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153) at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83) at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730) at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) at java.naming/javax.naming.InitialContext.init(InitialContext.java:236) at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208) at java.naming/javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101) at DeadServerTimeoutSSLTest.call(DeadSSLLdapTimeoutTest.java:120) ... 7 more Caused by: java.net.SocketTimeoutException at java.base/java.net.SocksSocketImpl.remainingMillis(SocksSocketImpl.java:122) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:402) at java.base/java.net.Socket.connect(Socket.java:591) at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:285) at java.naming/com.sun.jndi.ldap.Connection.createSocket(Connection.java:282) at java.naming/com.sun.jndi.ldap.Connection.<init>(Connection.java:202) ... 21 more
30-05-2018

Pushed to sandbox TLS 1.3 branch http://hg.openjdk.java.net/jdk/sandbox/rev/a725ee6ccaea
22-05-2018

The timed out is expected, but the exception hierarchy is changed. JDK 11: CommunicationException-->SocketTimeoutException TLS 1.3: CommunicationException-->SSLException-->SocketTimeoutException
10-05-2018

Run the test against JDK 11 javax.naming.CommunicationException: localhost:51995 [Root exception is java.net.SocketTimeoutException: Read timed out] at java.naming/com.sun.jndi.ldap.Connection.<init>(Connection.java:223) at java.naming/com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137) at java.naming/com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1616) at java.naming/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2752) at java.naming/com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:320) at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192) at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210) at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153) at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83) at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730) at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) at java.naming/javax.naming.InitialContext.init(InitialContext.java:236) at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208) at java.naming/javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101) at DeadServerTimeoutSSLTest.call(DeadSSLLdapTimeoutTest.java:120) at DeadSSLLdapTimeoutTest.main(DeadSSLLdapTimeoutTest.java:201) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115) at java.base/java.lang.Thread.run(Thread.java:832) Caused by: java.net.SocketTimeoutException: Read timed out at java.base/java.net.SocketInputStream.socketRead0(Native Method) at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115) at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168) at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140) at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:425) at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:154) at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1031) at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) at java.base/sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1402) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1429) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) at java.naming/com.sun.jndi.ldap.Connection.createSocket(Connection.java:329) at java.naming/com.sun.jndi.ldap.Connection.<init>(Connection.java:202) ... 21 more
10-05-2018