javax.net.ssl.SSLException: bad record MAC
843811Jul 2 2005 — edited Aug 4 2005Hello,
I am having some strange problems with a NIO/SSL server I wrote.
I am using SSLEngine to encrypt the communications. The NIO server is non-blocking. The client is using classic blocking SSLSockets. The NIO Server si just an echo server i.e. just returns to the client the message it received. The client, sends at random times a short string to the server.
After hanshaking is completed with on problems, sometimes (even after hours or days) I get the following ssl exception:
javax.net.ssl.SSLException: bad record MAC
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(Unknown Source)
at javax.net.ssl.SSLEngine.unwrap(Unknown Source)
at network.NIOSession.onSSLRead(NIOSession.java:95)
at network.NIOServer.handleRead(NIOServer.java:131)
at network.NIOServer.acceptConnections(NIOServer.java:89)
at network.NIOServer$1.run(NIOServer.java:32)
at java.lang.Thread.run(Unknown Source)
Any ideeas?
System info:
WinXP SP2
java version "1.5.0_04"
Regards,
Horia