users@grizzly.java.net

Re: SSLReadFilter - bad_record_mac error under load?

From: D. J. Hagberg (Sun) <"D.>
Date: Sat, 30 Jun 2007 15:35:49 -0600

I think I may have just had my Homer Simpson moment -- D'oh!!!

What I think is happening is that I have multiple WorkerThread's all
calling SSLOutputWriter.flushChannel on the *same* SelectorKey at the
same time.

This should have been obvious to me earlier, but.... that's bad, right?

;-)

                        -=- D. J.

D. J. Hagberg (Sun) wrote:
> Just wondering if anyone else has seen an error like this when sending
> lots of little messages or one big (50k) message over the SSL NIO
> support in Grizzly. (Note: my client on the other end of my
> Grizzly-based server uses the old-style SSLSocket blocking IO, not that
> that should make any difference).
>
> I'll try to work up a test for this to make sure I can reproduce it
> outside my application... But I seem to remember having seen something
> about this MAC error in the Glassfish bugfix release notes.
>
> -=- D. J.
>
> Jun 30, 2007 3:11:16 PM com.sun.grizzly.util.SSLUtils unwrapAll
> FINE: unwrap
> javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
> at
> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:166)
> at
> com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1352)
> at
> com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1320)
> at
> com.sun.net.ssl.internal.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1482)
>
> at
> com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:957)
>
> at
> com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:782)
>
> at
> com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:674)
> at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
> at com.sun.grizzly.util.SSLUtils.unwrap(SSLUtils.java:231)
> at com.sun.grizzly.util.SSLUtils.unwrapAll(SSLUtils.java:183)
> at
> com.sun.grizzly.filter.SSLReadFilter.doRead(SSLReadFilter.java:300)
> at
> com.sun.grizzly.filter.SSLReadFilter.execute(SSLReadFilter.java:146)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:77)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:56)
> at com.sun.grizzly.Context.call(Context.java:250)
> at
> com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:138)
> Jun 30, 2007 3:11:16 PM com.sun.srs.tunneling.server.nio.MsgWorkerThread
> run
> SEVERE: MsgWorkerThread unexpected exception:
> java.io.IOException: Broken pipe
> at sun.nio.ch.FileDispatcher.write0(Native Method)
> at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
> at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
> at sun.nio.ch.IOUtil.write(IOUtil.java:75)
> at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
> at
> com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:88)
> at
> com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:57)
> at
> com.sun.grizzly.util.SSLOutputWriter.flushChannel(SSLOutputWriter.java:98)
> at
> com.sun.grizzly.util.SSLOutputWriter.flushChannel(SSLOutputWriter.java:67)
> at
> com.sun.srs.tunneling.server.handlers.MsgTask.writeMessage(MsgTask.java:134)
>
> at
> com.sun.srs.tunneling.server.handlers.MsgWriteTask.call(MsgWriteTask.java:30)
>
> at
> com.sun.srs.tunneling.server.nio.MsgWorkerThread.run(MsgWorkerThread.java:58)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>