You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by kamalakannan chandrakumar <ch...@gmail.com> on 2015/09/28 12:17:43 UTC

Re: NIO2 SSL Handshake usage

Hi,

>
> Please let me why there is no way to set Handler class or Future task is
> not returned for
> SSL handshake in SecureNIO2Channel. How to use those classes for writing
> client code ?
> This was working fine with NIO code (SecureNIOChannel).
>
> Regards,
> Kamal.
>
>
>
>
>
>

Re: NIO2 SSL Handshake usage

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Kamal,

On 9/28/15 7:47 AM, kamalakannan chandrakumar wrote:
> Thanks ! If it is not for external purpose, pl let me know which
> API should I look to use NIO2 SSL implementation. This is for
> testing java client code to communicate with server.

Are you trying to use an NIO2 client as a test against Tomcat? Or are
you trying to test Tomcat's NIO2 connector, and you don't really care
what the client is?

ApacheBench ("ab") from the httpd project is a fairly good client,
though it's got some threading issues which make it non-ideal. It is
very easy to use, though.

Apache JMeter is a great client, but requires more in the way of setup.

If you want to use NIO2 for writing your own client, I you're going to
have to adapt the code to meet your needs... probably by liberally
stealing the code and not trying to use an "API" that Tomcat doesn't
actually provide.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJWCbpIAAoJEBzwKT+lPKRYZVcP/0S4QtCIqMzVu9I+spYHZOkJ
gVsa+RAJ3/nF8T4W1o6K2qE+J84fAkblyH/GzdAdCXC79QNMwOOenqVYXKdlZeCx
oA4QgaOUgGtGGKrtHW1tsBCKQYofK4INX68l+8SLMVEmDKroIsbz77xx9ZGFzuJc
urqKSGtRLdP1QkYfcmVMn8sU123rEozQ4bujfxly6VR2x+i3Rm5MfjmnT5UUgY4z
QxVyFfoYXRvG7bPLN+DhdHjqIOyPVqEckiHQw14rzrcT6c8HcYwRFwNZqMTerDWB
4IrEc+DwrPu5AbZkhv84qQwBw4+QoHZ9wZtABbYVuBbQTy4AhOst7O/T+k8wAWAU
kNr9w+5f6oSeAOIzEmaBuDdAlm1qfmyHiYOyGTS97UKKh7Rk71xJdBQ7od/hPDYv
Bq4LBeaTT1DGJEwiBu7781hHvNKxn7QjY2vpwe9R0Vyg1JqYnrSopaWGCDp48htm
xVlV+sp1ZevnyhGIUXhwg7sh0UwDxYlZemcDfwYKJoKgwMWxDwMKG0K2HOKyxXpm
pu+OPV72xQWykCB8OtufvEnnQ9FSquuJ6GYusqM71jCaERasoKKR2ZJv307s7P8k
k7MyaE7TEgBuvp+VxGi12rO82Ksmyg+ErcWLbnutyKJHeBA9De4S09omTAYTqhRu
gGo9L1iN7lfQWitjj5Qc
=7Otz
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: NIO2 SSL Handshake usage

Posted by kamalakannan chandrakumar <ch...@gmail.com>.
Thanks ! If it is not for external purpose, pl let me know which API should
I look
to use NIO2 SSL implementation.
This is for testing java client code to communicate with server.

Regards,
Kamal.

On Mon, Sep 28, 2015 at 4:49 PM, Mark Thomas <ma...@apache.org> wrote:

> On 28/09/2015 12:16, kamalakannan chandrakumar wrote:
> > Mark,
> >
> > Thanks! Just curious to know how it is used internally for NIO2.
> > I understand that it is internal, but please let me know the details.
>
> Try reading the source code.
>
> There is no API to set the completion handler because that is handled
> internally to the class. Look at handshakeReadCompletionHandler and
> handshakeWriteCompletionHandler.
>
> Mark
>
>
> >
> > Regards,
> > Kamal.
> >
> > On Mon, Sep 28, 2015 at 4:44 PM, Mark Thomas <ma...@apache.org> wrote:
> >
> >> On 28/09/2015 11:50, kamalakannan chandrakumar wrote:
> >>> I'm not talking about Handler classes in SecureNIOChannel.
> >>> It is for SecureNIO2Channel.
> >>
> >> Those are internal Tomcat classes. They are not designed for re-use
> >> outside of Tomcat.
> >>
> >> Mark
> >>
> >>>
> >>> Regards,
> >>> Kamal.
> >>>
> >>>
> >>> On Mon, Sep 28, 2015 at 3:58 PM, Rémy Maucherat <re...@apache.org>
> wrote:
> >>>
> >>>> 2015-09-28 12:17 GMT+02:00 kamalakannan chandrakumar <
> >>>> chandrakumarkamalakannan@gmail.com>:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>>>
> >>>>>> Please let me why there is no way to set Handler class or Future
> task
> >>>> is
> >>>>>> not returned for
> >>>>>> SSL handshake in SecureNIO2Channel. How to use those classes for
> >>>> writing
> >>>>>> client code ?
> >>>>>> This was working fine with NIO code (SecureNIOChannel).
> >>>>>
> >>>>> I don't understand. Can you clarify what is this handler you are
> >> talking
> >>>> about in the SecureNioChannel class ?
> >>>>
> >>>> Rémy
> >>>>
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: NIO2 SSL Handshake usage

Posted by Mark Thomas <ma...@apache.org>.
On 28/09/2015 12:16, kamalakannan chandrakumar wrote:
> Mark,
> 
> Thanks! Just curious to know how it is used internally for NIO2.
> I understand that it is internal, but please let me know the details.

Try reading the source code.

There is no API to set the completion handler because that is handled
internally to the class. Look at handshakeReadCompletionHandler and
handshakeWriteCompletionHandler.

Mark


> 
> Regards,
> Kamal.
> 
> On Mon, Sep 28, 2015 at 4:44 PM, Mark Thomas <ma...@apache.org> wrote:
> 
>> On 28/09/2015 11:50, kamalakannan chandrakumar wrote:
>>> I'm not talking about Handler classes in SecureNIOChannel.
>>> It is for SecureNIO2Channel.
>>
>> Those are internal Tomcat classes. They are not designed for re-use
>> outside of Tomcat.
>>
>> Mark
>>
>>>
>>> Regards,
>>> Kamal.
>>>
>>>
>>> On Mon, Sep 28, 2015 at 3:58 PM, Rémy Maucherat <re...@apache.org> wrote:
>>>
>>>> 2015-09-28 12:17 GMT+02:00 kamalakannan chandrakumar <
>>>> chandrakumarkamalakannan@gmail.com>:
>>>>
>>>>> Hi,
>>>>>
>>>>>>
>>>>>> Please let me why there is no way to set Handler class or Future task
>>>> is
>>>>>> not returned for
>>>>>> SSL handshake in SecureNIO2Channel. How to use those classes for
>>>> writing
>>>>>> client code ?
>>>>>> This was working fine with NIO code (SecureNIOChannel).
>>>>>
>>>>> I don't understand. Can you clarify what is this handler you are
>> talking
>>>> about in the SecureNioChannel class ?
>>>>
>>>> Rémy
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: NIO2 SSL Handshake usage

Posted by kamalakannan chandrakumar <ch...@gmail.com>.
Mark,

Thanks! Just curious to know how it is used internally for NIO2.
I understand that it is internal, but please let me know the details.

Regards,
Kamal.

On Mon, Sep 28, 2015 at 4:44 PM, Mark Thomas <ma...@apache.org> wrote:

> On 28/09/2015 11:50, kamalakannan chandrakumar wrote:
> > I'm not talking about Handler classes in SecureNIOChannel.
> > It is for SecureNIO2Channel.
>
> Those are internal Tomcat classes. They are not designed for re-use
> outside of Tomcat.
>
> Mark
>
> >
> > Regards,
> > Kamal.
> >
> >
> > On Mon, Sep 28, 2015 at 3:58 PM, Rémy Maucherat <re...@apache.org> wrote:
> >
> >> 2015-09-28 12:17 GMT+02:00 kamalakannan chandrakumar <
> >> chandrakumarkamalakannan@gmail.com>:
> >>
> >>> Hi,
> >>>
> >>>>
> >>>> Please let me why there is no way to set Handler class or Future task
> >> is
> >>>> not returned for
> >>>> SSL handshake in SecureNIO2Channel. How to use those classes for
> >> writing
> >>>> client code ?
> >>>> This was working fine with NIO code (SecureNIOChannel).
> >>>
> >>> I don't understand. Can you clarify what is this handler you are
> talking
> >> about in the SecureNioChannel class ?
> >>
> >> Rémy
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: NIO2 SSL Handshake usage

Posted by Mark Thomas <ma...@apache.org>.
On 28/09/2015 11:50, kamalakannan chandrakumar wrote:
> I'm not talking about Handler classes in SecureNIOChannel.
> It is for SecureNIO2Channel.

Those are internal Tomcat classes. They are not designed for re-use
outside of Tomcat.

Mark

> 
> Regards,
> Kamal.
> 
> 
> On Mon, Sep 28, 2015 at 3:58 PM, Rémy Maucherat <re...@apache.org> wrote:
> 
>> 2015-09-28 12:17 GMT+02:00 kamalakannan chandrakumar <
>> chandrakumarkamalakannan@gmail.com>:
>>
>>> Hi,
>>>
>>>>
>>>> Please let me why there is no way to set Handler class or Future task
>> is
>>>> not returned for
>>>> SSL handshake in SecureNIO2Channel. How to use those classes for
>> writing
>>>> client code ?
>>>> This was working fine with NIO code (SecureNIOChannel).
>>>
>>> I don't understand. Can you clarify what is this handler you are talking
>> about in the SecureNioChannel class ?
>>
>> Rémy
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: NIO2 SSL Handshake usage

Posted by kamalakannan chandrakumar <ch...@gmail.com>.
I'm not talking about Handler classes in SecureNIOChannel.
It is for SecureNIO2Channel.

Regards,
Kamal.


On Mon, Sep 28, 2015 at 3:58 PM, Rémy Maucherat <re...@apache.org> wrote:

> 2015-09-28 12:17 GMT+02:00 kamalakannan chandrakumar <
> chandrakumarkamalakannan@gmail.com>:
>
> > Hi,
> >
> > >
> > > Please let me why there is no way to set Handler class or Future task
> is
> > > not returned for
> > > SSL handshake in SecureNIO2Channel. How to use those classes for
> writing
> > > client code ?
> > > This was working fine with NIO code (SecureNIOChannel).
> >
> > I don't understand. Can you clarify what is this handler you are talking
> about in the SecureNioChannel class ?
>
> Rémy
>

Re: NIO2 SSL Handshake usage

Posted by Rémy Maucherat <re...@apache.org>.
2015-09-28 12:17 GMT+02:00 kamalakannan chandrakumar <
chandrakumarkamalakannan@gmail.com>:

> Hi,
>
> >
> > Please let me why there is no way to set Handler class or Future task is
> > not returned for
> > SSL handshake in SecureNIO2Channel. How to use those classes for writing
> > client code ?
> > This was working fine with NIO code (SecureNIOChannel).
>
> I don't understand. Can you clarify what is this handler you are talking
about in the SecureNioChannel class ?

Rémy