Bruce Grembowski
Bruce Grembowski

Reputation: 1

BouncyCastle 1.77 generating Failed to read/write record errors in jdk1.6.0_24

I am trying to add TLS1.2 support to a Java 6 application using BC 1.77 on jdk1.6.0_24, running on Tomcat 6 and Windows Server 2019 Standard.

Everything is working fine with the application, and I am able to connect at https://(domain):8443, but I am having an issue with errors being generated in catalina.log, similar to these two:

Sep 27, 2024 9:19:09 AM org.bouncycastle.jsse.provider.ProvTlsServer notifyAlertRaised
WARNING: Server raised fatal(2) internal_error(80) alert: Failed to write record
java.net.SocketException: Software caused connection abort: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at org.bouncycastle.tls.RecordStream.writeRecord(Unknown Source)
    at org.bouncycastle.tls.TlsProtocol.safeWriteRecord(Unknown Source)
    at org.bouncycastle.tls.TlsProtocol.writeHandshakeMessage(Unknown Source)
    at org.bouncycastle.tls.HandshakeMessageOutput.send(Unknown Source)
    at org.bouncycastle.tls.TlsProtocol.sendCertificateMessage(Unknown Source)
    at org.bouncycastle.tls.TlsServerProtocol.handleHandshakeMessage(Unknown Source)
    at org.bouncycastle.tls.TlsProtocol.processHandshakeQueue(Unknown Source)
    at org.bouncycastle.tls.TlsProtocol.processRecord(Unknown Source)
    at org.bouncycastle.tls.RecordStream.readRecord(Unknown Source)
    at org.bouncycastle.tls.TlsProtocol.safeReadRecord(Unknown Source)
    at org.bouncycastle.tls.TlsProtocol.blockForHandshake(Unknown Source)
    at org.bouncycastle.tls.TlsServerProtocol.accept(Unknown Source)
    at org.bouncycastle.jsse.provider.ProvSSLSocketDirect.startHandshake(Unknown Source)
    at org.bouncycastle.jsse.provider.ProvSSLSocketDirect.startHandshake(Unknown Source)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.handshake(JSSESocketFactory.java:187)
    at org.apache.tomcat.util.net.JIoEndpoint.setSocketOptions(JIoEndpoint.java:686)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)

and

Sep 27, 2024 9:36:25 AM org.bouncycastle.jsse.provider.ProvTlsServer notifyAlertRaised
WARNING: Server raised fatal(2) internal_error(80) alert: Failed to read record
java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at org.bouncycastle.tls.RecordStream$Record.fillTo(Unknown Source)
    at org.bouncycastle.tls.RecordStream$Record.readHeader(Unknown Source)
    at org.bouncycastle.tls.RecordStream.readRecord(Unknown Source)
    at org.bouncycastle.tls.TlsProtocol.safeReadRecord(Unknown Source)
    at org.bouncycastle.tls.TlsProtocol.readApplicationData(Unknown Source)
    at org.bouncycastle.jsse.provider.ProvSSLSocketDirect$AppDataInput.read(Unknown Source)
    at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:735)
    at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:366)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:814)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)

These errors are not affecting the application, but they are filling up the logs.

Can anyone help me determine what is causing these errors?

Please let me know if you need any more information.

I have checked the discussions in the BouncyCastle github repository and StackOverflow, but nothing has helped.

I did update from using BC 1.71 to 1.77; the results are the same for both versions.

Specifically, I have the following BC libraries in jdk1.6.0_24\jre\lib\ext:

bcprov-jdk15to18-177.jar
bctls-jdk15to18-177.jar
bcutil-jdk15to18-177.jar

All I could find on the web were issues where the application didn't work with TLS1.2, but I am not having that problem. The application is working exactly as it should, I am just getting all these errors in the Tomcat logs.

Can anyone help me determine what is causing these errors?

Please let me know if you need any more information.

Upvotes: 0

Views: 57

Answers (0)

Related Questions