Failing to establish TLS when using Java 11

Description

When using Java 11, some TLS sessions fail to get established properly. Exceptions like these are logged:

The remote peer perceives this as a timeout.

Environment

None

Activity

Show:
Guus der Kinderen
August 9, 2019, 12:11 PM
Guus der Kinderen
August 9, 2019, 11:28 AM
Edited

This looks like something similar to OF-1009. It appears that sockets are being closed "to soon", which causes an exception.

https://docs.oracle.com/en/java/javase/11/docs/api/java.base/javax/net/ssl/SSLSocket.html hints at there being a proper way to close sessions:

When the connection is no longer needed, the client and server applications should each close both sides of their respective connection. For SSLSocket objects, for example, an application can call Socket.shutdownOutput()or OutputStream.close() for output strean close and call Socket.shutdownInput() or InputStream.close() for input stream close. Note that in some cases, closing the input stream may depend on the peer's output stream being closed first. If the connection is not closed in an orderly manner (for example Socket.shutdownInput() is called before the peer's write closure notification has been received), exceptions may be raised to indicate that an error has occurred. Once an SSLSocket is closed, it is not reusable: a new SSLSocket must be created.

Fixed

Assignee

Guus der Kinderen

Reporter

Guus der Kinderen