users@grizzly.java.net

Re: SSL + remote closing: bug.

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 01 Dec 2008 12:56:10 -0500

Salut,

Amy Kang wrote:
> Hi Jeanfrancois,
>
> When not setting selection key handler explicitly, the following will
> return null
> SelectionKeyHandler keyHandler =
> sslSelectorHandler.getSelectionKeyHandler();

Hum let me take a look. I was under the impression the
BaseSelectionKeyHandler was also used, but I might have missed something.

>
> during setup stage, hence my code
> if (keyHandler instanceof BaseSelectionKeyHandler) {
> ((BaseSelectionKeyHandler)keyHandler).setConnectionCloseHandler(this);
> }
>
> was not executed.
>

Thanks for confirming!

--Jeanfrancois


> amy
>
> On 11/27/08 10:08, Jeanfrancois Arcand wrote:
>> Salut,
>>
>> I think I was too fast when I replied...I can't reproduce the issue
>> when I use openssl (like telnet):
>>
>> & openssl s_client -connect localhost:8181
>>
>> I do get the event. Still looking.
>>
>> A+
>>
>> -- Jeanfrancois
>>
>> Jeanfrancois Arcand wrote:
>>> Salut,
>>>
>>> Amy Kang wrote:
>>>> Hi, Jeanfrancois,
>>>>
>>>> Thanks. I actually downloaded maven last night (I realized Grizzly
>>>> uses maven)
>>>> and built grizzly framework from trunk and tried following:
>>>>
>>>> kill remote client --> notified remotelyClosed
>>>> remote connected but shutdown Grizzly on server side --> notified
>>>> locallyClosed
>>>>
>>>> worked as expected for TCP (tried on Solaris), but for SSL, I didn't
>>>> get notified.
>>>> Maybe it's the way I setup SSL. The following is what I do for SSL
>>>> setup,
>>>>
>>>> SSLSelectorHandler sslSelectorHandler = new SSLSelectorHandler();
>>>> sslSelectorHandler.setPort(SSLPORT);
>>>> controller.addSelectorHandler(sslSelectorHandler);
>>>>
>>>> Properties sslprops = _bc.getDefaultSSLContextConfig();
>>>> SSLConfig sslcf = new SSLConfig(false);
>>>>
>>>> sslcf.setKeyStoreFile(sslprops.getProperty(_bc.KEYSTORE_FILE));
>>>> .......
>>>> SelectionKeyHandler keyHandler =
>>>> sslSelectorHandler.getSelectionKeyHandler();
>>>> if (keyHandler instanceof BaseSelectionKeyHandler) {
>>>>
>>>> ((BaseSelectionKeyHandler)keyHandler).setConnectionCloseHandler(this);
>>>> }
>>>> .....
>>>>
>>>> The only difference is for TCP I set BaseSelectionHandler explicitly
>>>> , for SSL I use
>>>> what's default in SSLSelectorHandler.
>>>
>>> That's a bug. The fix is coming.
>>>
>>> Thanks for the hint!
>>>
>>> -- Jeanfrancois
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>