users@grizzly.java.net

Re: Problem with SSL

From: John ROM <snake-john_at_gmx.de>
Date: Sun, 28 Sep 2008 21:54:54 +0200

Hello Quende,
could you send your full example source code?
It would make it easier to find the problem...


>
>Hello, John!
>Thanks for your reply. Your advice was extremely useful. It turned out that
>the framework couldn't find trust store file when creating SSLContext. I
>have fixed it, but now i encounter a strange behavoiur:
>I am dealing with testSimplePacket() function taken from
>https://grizzly.dev.java.net/nonav/xref-test/com/sun/grizzly/SSLConnectionTest.html
>Sometimes I get Handshake done fine, but in most cases i get

...
com.sun.grizzly.filter.SSLReadFilter.doHandshake(SSLReadFilter.java:223)
com.sun.grizzly.filter.SSLReadFilter.execute(SSLReadFilter.java:154)
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:309)
com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:168)
Sep 28, 2008 9:58:01 PM com.sun.grizzly.util.SSLUtils unwrap
FINE: after unwrap. buffer: java.nio.HeapByteBuffer[pos=0 lim=16660
cap=16660] secured: java.nio.HeapByteBuffer[pos=0 lim=20480 cap=20480]
consumed: 100 produced: 0 status: OK
Sep 28, 2008 9:58:01 PM com.sun.grizzly.Controller doSelect
FINE: OP_READ on sun.nio.ch.SelectionKeyImpl_at_1837697
Sep 28, 2008 9:58:01 PM com.sun.grizzly.Controller pollContext
FINE: pollContext(..) Context : com.sun.grizzly.Context_at_a20892
Sep 28, 2008 9:58:02 PM com.sun.grizzly.Controller returnContext
FINE: returnContext() Context : com.sun.grizzly.Context_at_a20892
Sep 28, 2008 9:58:11 PM com.sun.grizzly.Controller doSelect
FINE: OP_READ on sun.nio.ch.SelectionKeyImpl_at_1837697
Sep 28, 2008 9:58:11 PM com.sun.grizzly.Controller pollContext
FINE: pollContext(..) Context : com.sun.grizzly.Context_at_2c84d9
Sep 28, 2008 9:58:11 PM
com.sun.grizzly.SSLConnectorHandler$SSLInternalCallbackHandler onRead
SEVERE: Exception occured when reading from SSL channel.
java.nio.channels.ClosedChannelException
        at
sun.nio.ch.SocketChannelImpl.ensureReadOpen(SocketChannelImpl.java:113)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:156)
        at
com.sun.grizzly.SSLConnectorHandler.doReadAsync(SSLConnectorHandler.java:923)
        at
com.sun.grizzly.SSLConnectorHandler.doAsyncHandshake(SSLConnectorHandler.java:1027)
        at
com.sun.grizzly.SSLConnectorHandler.access$800(SSLConnectorHandler.java:108)
        at
com.sun.grizzly.SSLConnectorHandler$SSLInternalCallbackHandler.onRead(SSLConnectorHandler.java:1189)
        at
com.sun.grizzly.CallbackHandlerContextTask.doCall(CallbackHandlerContextTask.java:76)
        at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
        at
com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:309)
        at
com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:168)
Sep 28, 2008 9:58:11 PM com.sun.grizzly.Controller returnContext
FINE: returnContext() Context : com.sun.grizzly.Context_at_2c84d9

And the handshake fails. What should i do to avoid such things? Is that
because of implementation of SSLConnectionTest class (i took it without
making changes just for a test), or maybe there are some extra
connection-options I should look for?

Your help is very useful. Thank you once more!
Quende

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx