Skip to content

Loading…

Sporadic javax.crypto.BadPaddingException #1062

Closed
eric opened this Issue · 3 comments

3 participants

@eric

I am using netty 3.6.0.Beta1 and have found that from time to time we are seeing BadPaddingException.

I have not been able to identify if it is a misbehaving client or if there is some other problem. Is this something you have heard of before? Is there anything I can do to help track down the source of the issue?

Here's an example stack trace:

WARN  [2013-02-20 07:45:01,880] javax.net.ssl.SSLHandshakeException: Invalid padding
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1703)
    at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:971)
    at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:884)
    at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:758)
    at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
    at org.jboss.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1118)
    at org.jboss.netty.handler.ssl.SslHandler.decode(SslHandler.java:814)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:422)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:84)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:471)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:332)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 243
    at sun.security.ssl.CipherBox.removePadding(CipherBox.java:621)
    at sun.security.ssl.CipherBox.decrypt(CipherBox.java:421)
    at sun.security.ssl.InputRecord.decrypt(InputRecord.java:172)
    at sun.security.ssl.EngineInputRecord.decrypt(EngineInputRecord.java:257)
    at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:953)
    ... 16 more

and an incomplete list of exceptions I've seen:

Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 64
Caused by: javax.crypto.BadPaddingException: Padding length invalid: 112
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 225
Caused by: javax.crypto.BadPaddingException: Padding length invalid: 63
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 216
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 241
Caused by: javax.crypto.BadPaddingException: Padding length invalid: 149
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 181
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 142
Caused by: javax.crypto.BadPaddingException: Padding length invalid: 218
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 200
Caused by: javax.crypto.BadPaddingException: Padding length invalid: 41
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 211
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 17
Caused by: javax.crypto.BadPaddingException: Padding length invalid: 142
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 49
Caused by: javax.crypto.BadPaddingException: Padding length invalid: 186
Caused by: javax.crypto.BadPaddingException: Padding length invalid: 148
Caused by: javax.crypto.BadPaddingException: Padding length invalid: 186
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 99
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 247
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding: 243
@normanmaurer
The Netty Project member

@eric looks more like a bad client... So I think nothing we can do about it.. Please reopen if you think it is really a bug

@idcmp

@eric Are you using jdk7 u6 or higher? Does this problem go away if you downgrade to u5? If so, this may be happening to you: https://forums.oracle.com/forums/thread.jspa?messageID=10875177&tstart=0

@eric

Thanks for the info! I'm running jdk7 u9.

@jimbaker jimbaker referenced this issue in jimbaker/socket-reboot
Open

Documentation updates #6

0 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.