BadPaddingException using RTMPS

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

BadPaddingException using RTMPS

taze170171
Hello!

We are using AIR, LCDS (running on a JBoss) and an RTMPS connection.
Sometimes we get the following exception, when the AIR client tries
to connect to the server:

[Flex]Thread[my-rtmps-SocketServer-WorkerThread-88,5,jboss] failed to
read Connection 'xxx' or process the data; Connection is in
the 'Handshaking' state and will be forced closed.
javax.net.ssl.SSLHandshakeException: Invalid padding
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException
(Alerts.java:150)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal
(SSLEngineImpl.java:1417)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
(SSLEngineImpl.java:874)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord
(SSLEngineImpl.java:787)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap
(SSLEngineImpl.java:663)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
at flex.messaging.socketserver.SSLConnection.handshake
(SSLConnection.java:301)
at flex.messaging.socketserver.Connection$ConnectionReader.run
(Connection.java:761)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.runTask(ThreadPoolExecutor.java:665)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)

Caused by: javax.crypto.BadPaddingException: Padding length invalid:
244
at com.sun.net.ssl.internal.ssl.CipherBox.removePadding
(CipherBox.java:442)
at com.sun.net.ssl.internal.ssl.CipherBox.decrypt(CipherBox.java:290)
at com.sun.net.ssl.internal.ssl.InputRecord.decrypt
(InputRecord.java:153)
at com.sun.net.ssl.internal.ssl.EngineInputRecord.decrypt
(EngineInputRecord.java:238)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
(SSLEngineImpl.java:856)
... 8 more

Can anybody help?

Thanks in advance,
Taze

Reply | Threaded
Open this post in threaded view
|

RE: BadPaddingException using RTMPS

Jeff Vroom
Are you running the released version of 2.6?   There was a bug in RTMPS in that version which is fixed in a hotfix or in 2.6.1 that might cause this type of error intermittently.

Jeff

From: [hidden email] [mailto:[hidden email]] On Behalf Of taze170171
Sent: Friday, December 12, 2008 5:52 AM
To: [hidden email]
Subject: [flexcoders] BadPaddingException using RTMPS


Hello!

We are using AIR, LCDS (running on a JBoss) and an RTMPS connection.
Sometimes we get the following exception, when the AIR client tries
to connect to the server:

[Flex]Thread[my-rtmps-SocketServer-WorkerThread-88,5,jboss] failed to
read Connection 'xxx' or process the data; Connection is in
the 'Handshaking' state and will be forced closed.
javax.net.ssl.SSLHandshakeException: Invalid padding
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException
(Alerts.java:150)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal
(SSLEngineImpl.java:1417)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
(SSLEngineImpl.java:874)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord
(SSLEngineImpl.java:787)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap
(SSLEngineImpl.java:663)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
at flex.messaging.socketserver.SSLConnection.handshake
(SSLConnection.java:301)
at flex.messaging.socketserver.Connection$ConnectionReader.run
(Connection.java:761)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.runTask(ThreadPoolExecutor.java:665)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)

Caused by: javax.crypto.BadPaddingException: Padding length invalid:
244
at com.sun.net.ssl.internal.ssl.CipherBox.removePadding
(CipherBox.java:442)
at com.sun.net.ssl.internal.ssl.CipherBox.decrypt(CipherBox.java:290)
at com.sun.net.ssl.internal.ssl.InputRecord.decrypt
(InputRecord.java:153)
at com.sun.net.ssl.internal.ssl.EngineInputRecord.decrypt
(EngineInputRecord.java:238)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
(SSLEngineImpl.java:856)
... 8 more

Can anybody help?

Thanks in advance,
Taze


image001.jpg (486 bytes) Download Attachment
image002.jpg (456 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: BadPaddingException using RTMPS

taze170171
Hello Jeff!

Thank you for your answer. We are using LCDS 2.6.1. and Flex SDK 3.2.

Best regards,
Taze

--- In [hidden email], Jeff Vroom <jvroom@...> wrote:
>
> Are you running the released version of 2.6?   There was a bug in
RTMPS in that version which is fixed in a hotfix or in 2.6.1 that
might cause this type of error intermittently.
>
> Jeff
>
> From: [hidden email]
[mailto:[hidden email]] On Behalf Of taze170171

> Sent: Friday, December 12, 2008 5:52 AM
> To: [hidden email]
> Subject: [flexcoders] BadPaddingException using RTMPS
>
>
> Hello!
>
> We are using AIR, LCDS (running on a JBoss) and an RTMPS connection.
> Sometimes we get the following exception, when the AIR client tries
> to connect to the server:
>
> [Flex]Thread[my-rtmps-SocketServer-WorkerThread-88,5,jboss] failed
to

> read Connection 'xxx' or process the data; Connection is in
> the 'Handshaking' state and will be forced closed.
> javax.net.ssl.SSLHandshakeException: Invalid padding
> at com.sun.net.ssl.internal.ssl.Alerts.getSSLException
> (Alerts.java:150)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal
> (SSLEngineImpl.java:1417)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
> (SSLEngineImpl.java:874)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord
> (SSLEngineImpl.java:787)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap
> (SSLEngineImpl.java:663)
> at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
> at flex.messaging.socketserver.SSLConnection.handshake
> (SSLConnection.java:301)
> at flex.messaging.socketserver.Connection$ConnectionReader.run
> (Connection.java:761)
> at
>
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
> er.runTask(ThreadPoolExecutor.java:665)
> at
>
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
> er.run(ThreadPoolExecutor.java:690)
> at java.lang.Thread.run(Thread.java:595)
>
> Caused by: javax.crypto.BadPaddingException: Padding length invalid:
> 244
> at com.sun.net.ssl.internal.ssl.CipherBox.removePadding
> (CipherBox.java:442)
> at com.sun.net.ssl.internal.ssl.CipherBox.decrypt
(CipherBox.java:290)

> at com.sun.net.ssl.internal.ssl.InputRecord.decrypt
> (InputRecord.java:153)
> at com.sun.net.ssl.internal.ssl.EngineInputRecord.decrypt
> (EngineInputRecord.java:238)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
> (SSLEngineImpl.java:856)
> ... 8 more
>
> Can anybody help?
>
> Thanks in advance,
> Taze
>


Reply | Threaded
Open this post in threaded view
|

RE: Re: BadPaddingException using RTMPS

Seth Hodgson
Hi Taze,

Do these errors only occur during the SSL handshake (you can look for SSLHandshakeException in your stack traces)?
Are you using a CA certificate or a self-signed cert, and what algorithm, etc.?
Also, do you know if this is happening for connections from AIR clients running on Windows, Mac, Linux?

Best,
Seth

From: [hidden email] [mailto:[hidden email]] On Behalf Of taze170171
Sent: Monday, December 15, 2008 12:36 AM
To: [hidden email]
Subject: [flexcoders] Re: BadPaddingException using RTMPS

Hello Jeff!

Thank you for your answer. We are using LCDS 2.6.1. and Flex SDK 3.2.

Best regards,
Taze

--- In [hidden email], Jeff Vroom <jvroom@...> wrote:
>
> Are you running the released version of 2.6? There was a bug in
RTMPS in that version which is fixed in a hotfix or in 2.6.1 that
might cause this type of error intermittently.
>
> Jeff
>
> From: [hidden email]
[mailto:[hidden email]] On Behalf Of taze170171

> Sent: Friday, December 12, 2008 5:52 AM
> To: [hidden email]
> Subject: [flexcoders] BadPaddingException using RTMPS
>
>
> Hello!
>
> We are using AIR, LCDS (running on a JBoss) and an RTMPS connection.
> Sometimes we get the following exception, when the AIR client tries
> to connect to the server:
>
> [Flex]Thread[my-rtmps-SocketServer-WorkerThread-88,5,jboss] failed
to

> read Connection 'xxx' or process the data; Connection is in
> the 'Handshaking' state and will be forced closed.
> javax.net.ssl.SSLHandshakeException: Invalid padding
> at com.sun.net.ssl.internal.ssl.Alerts.getSSLException
> (Alerts.java:150)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal
> (SSLEngineImpl.java:1417)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
> (SSLEngineImpl.java:874)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord
> (SSLEngineImpl.java:787)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap
> (SSLEngineImpl.java:663)
> at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
> at flex.messaging.socketserver.SSLConnection.handshake
> (SSLConnection.java:301)
> at flex.messaging.socketserver.Connection$ConnectionReader.run
> (Connection.java:761)
> at
>
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
> er.runTask(ThreadPoolExecutor.java:665)
> at
>
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
> er.run(ThreadPoolExecutor.java:690)
> at java.lang.Thread.run(Thread.java:595)
>
> Caused by: javax.crypto.BadPaddingException: Padding length invalid:
> 244
> at com.sun.net.ssl.internal.ssl.CipherBox.removePadding
> (CipherBox.java:442)
> at com.sun.net.ssl.internal.ssl.CipherBox.decrypt
(CipherBox.java:290)

> at com.sun.net.ssl.internal.ssl.InputRecord.decrypt
> (InputRecord.java:153)
> at com.sun.net.ssl.internal.ssl.EngineInputRecord.decrypt
> (EngineInputRecord.java:238)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
> (SSLEngineImpl.java:856)
> ... 8 more
>
> Can anybody help?
>
> Thanks in advance,
> Taze
>
Reply | Threaded
Open this post in threaded view
|

Re: BadPaddingException using RTMPS

taze170171
In reply to this post by taze170171
Hello Seth!

We either get the SSLHandshake exception like below or the following:

javax.net.ssl.SSLException: Inbound closed before receiving peer's
close_notify: possible truncation attack?
        at com.sun.net.ssl.internal.ssl.Alerts.getSSLException
(Alerts.java:166)
        at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal
(SSLEngineImpl.java:1356)
        at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal
(SSLEngineImpl.java:1324)
        at com.sun.net.ssl.internal.ssl.SSLEngineImpl.closeInbound
(SSLEngineImpl.java:1263)
        at flex.messaging.socketserver.SSLConnection.handshake
(SSLConnection.java:290)
        at flex.messaging.socketserver.Connection$ConnectionReader.run
(Connection.java:761)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.runTask(ThreadPoolExecutor.java:665)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)

I have now found out, that the SSLHandshake exception occurs if an
AIR Client installed on Vista is started. On one Vista client we
always get the exception. On other Vista clients the problem occurs
sometimes.

We use a self signed cert.

Best regards,
Taze

--- In [hidden email], "taze170171" <taze170171@...>
wrote:
>
> Hello!
>
> We are using AIR, LCDS (running on a JBoss) and an RTMPS
connection.
> Sometimes we get the following exception, when the AIR client tries
> to connect to the server:
>
> [Flex]Thread[my-rtmps-SocketServer-WorkerThread-88,5,jboss] failed
to

> read Connection 'xxx' or process the data; Connection is in
> the 'Handshaking' state and will be forced closed.
> javax.net.ssl.SSLHandshakeException: Invalid padding
> at com.sun.net.ssl.internal.ssl.Alerts.getSSLException
> (Alerts.java:150)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal
> (SSLEngineImpl.java:1417)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
> (SSLEngineImpl.java:874)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord
> (SSLEngineImpl.java:787)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap
> (SSLEngineImpl.java:663)
> at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
> at flex.messaging.socketserver.SSLConnection.handshake
> (SSLConnection.java:301)
> at flex.messaging.socketserver.Connection$ConnectionReader.run
> (Connection.java:761)
> at
>
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
> er.runTask(ThreadPoolExecutor.java:665)
> at
>
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
> er.run(ThreadPoolExecutor.java:690)
> at java.lang.Thread.run(Thread.java:595)
>
> Caused by: javax.crypto.BadPaddingException: Padding length
invalid:
> 244
> at com.sun.net.ssl.internal.ssl.CipherBox.removePadding
> (CipherBox.java:442)
> at com.sun.net.ssl.internal.ssl.CipherBox.decrypt
(CipherBox.java:290)

> at com.sun.net.ssl.internal.ssl.InputRecord.decrypt
> (InputRecord.java:153)
> at com.sun.net.ssl.internal.ssl.EngineInputRecord.decrypt
> (EngineInputRecord.java:238)
> at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
> (SSLEngineImpl.java:856)
> ... 8 more
>
> Can anybody help?
>
> Thanks in advance,
> Taze
>