You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Philippe Mouawad <p....@ubik-ingenierie.com> on 2018/02/24 11:24:50 UTC

How to clear SSL State in HC4.5.5

Hello,

In current jmeter trunk when we have Client certificate authentication and
we need to reset SSL State so another SSLContext is created we do this:
https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L838


We are currently migrating to last 4.5 and would like to know what is the
clean way to reset SSL State ?
Since httpClient.getConnectionManager() is deprecated.
Should we keep a reference to PoolingHttpClientConnectionManager and call
those methods on it ?

Current state of migration is here:

   -
   https://github.com/ubikloadpack/jmeter/blob/HC4_FULL_MIGRATION/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L973


To recap, in JMeter we have 1 HttpClient per User (and this is needed as
per a previous discussion on this mailing list).

Thanks for your help.
-- 
Regards.
Philippe M.

Re: How to clear SSL State in HC4.5.5

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sun, 2018-03-11 at 17:57 +0100, Philippe Mouawad wrote:
> It looks a bit aggressive to me, but if you say it’s ok, it’s fine
> for me.
> 
> So you confirm I need to keep reference to
> poolingHttpClientConnectionManager right ?
> No way from httpclient
> 

HttpClient interface represents a generic client that may not
necessarily have a connection pool or even connection manager
internally. Coupling HttpClient interface with a specific connection
manager would force each and every HttpClient implementation to
implement that specific connection management contract as well.

Oleg


> Thanks
> On Sunday, March 11, 2018, Oleg Kalnichevski <ol...@apache.org>
> wrote:
> 
> > On Sun, 2018-03-11 at 15:57 +0100, Philippe Mouawad wrote:
> > > I mean starting with a fresh sslcontext.
> > > It works if I keep a ref on PoolingHttpConnectionManager and call
> > > 
> > > poolingHttppoolingHttpClientConnectionManagerClientConnectionMan
> > 
> > ager.closeExpiredConnections();
> > poolingHttpClientConnectionManager.closeIdleConnections(1L,
> > > TimeUnit.MICROSECONDS);
> > > 
> > > 
> > > But is there a better way ?
> > 
> > What is so bad about using the connection manager to close out all
> > persistent connections?
> > 
> > Oleg
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.or
> > g
> > 
> > 
> 
> 

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


Re: How to clear SSL State in HC4.5.5

Posted by Gary Gregory <ga...@gmail.com>.
Are we missing a getter?

Gary

On Sun, Mar 11, 2018, 10:57 Philippe Mouawad <ph...@gmail.com>
wrote:

> It looks a bit aggressive to me, but if you say it’s ok, it’s fine for me.
>
> So you confirm I need to keep reference to
> poolingHttpClientConnectionManager right ?
> No way from httpclient
>
> Thanks
> On Sunday, March 11, 2018, Oleg Kalnichevski <ol...@apache.org> wrote:
>
> > On Sun, 2018-03-11 at 15:57 +0100, Philippe Mouawad wrote:
> > > I mean starting with a fresh sslcontext.
> > > It works if I keep a ref on PoolingHttpConnectionManager and call
> > >
> > > poolingHttppoolingHttpClientConnectionManagerClientConnectionMan
> > ager.closeExpiredConnections();
>
> > poolingHttpClientConnectionManager.closeIdleConnections(1L,
> > > TimeUnit.MICROSECONDS);
> > >
> > >
> > > But is there a better way ?
> >
> > What is so bad about using the connection manager to close out all
> > persistent connections?
> >
> > Oleg
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> >
> >
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: How to clear SSL State in HC4.5.5

Posted by Philippe Mouawad <ph...@gmail.com>.
It looks a bit aggressive to me, but if you say it’s ok, it’s fine for me.

So you confirm I need to keep reference to
poolingHttpClientConnectionManager right ?
No way from httpclient

Thanks
On Sunday, March 11, 2018, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Sun, 2018-03-11 at 15:57 +0100, Philippe Mouawad wrote:
> > I mean starting with a fresh sslcontext.
> > It works if I keep a ref on PoolingHttpConnectionManager and call
> >
> > poolingHttppoolingHttpClientConnectionManagerClientConnectionMan
> ager.closeExpiredConnections();

> poolingHttpClientConnectionManager.closeIdleConnections(1L,
> > TimeUnit.MICROSECONDS);
> >
> >
> > But is there a better way ?
>
> What is so bad about using the connection manager to close out all
> persistent connections?
>
> Oleg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

-- 
Cordialement.
Philippe Mouawad.

Re: How to clear SSL State in HC4.5.5

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sun, 2018-03-11 at 15:57 +0100, Philippe Mouawad wrote:
> I mean starting with a fresh sslcontext.
> It works if I keep a ref on PoolingHttpConnectionManager and call
> 
> poolingHttpClientConnectionManager.closeExpiredConnections();
> poolingHttpClientConnectionManager.closeIdleConnections(1L,
> TimeUnit.MICROSECONDS);
> 
> 
> But is there a better way ?

What is so bad about using the connection manager to close out all
persistent connections?

Oleg

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


Re: How to clear SSL State in HC4.5.5

Posted by Philippe Mouawad <ph...@gmail.com>.
I mean starting with a fresh sslcontext.
It works if I keep a ref on PoolingHttpConnectionManager and call

poolingHttpClientConnectionManager.closeExpiredConnections();
poolingHttpClientConnectionManager.closeIdleConnections(1L,
TimeUnit.MICROSECONDS);


But is there a better way ?
Thanks

Regards
On Sunday, March 11, 2018, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Sat, 2018-03-10 at 14:08 +0100, Philippe Mouawad wrote:
> > ...
>
> > > Hello,
> > >
> > > In current jmeter trunk when we have Client certificate
> > > authentication and
> > > we need to reset SSL State so another SSLContext is created we do
> > > this:
> > > https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/a
> > > pache/
> > > jmeter/protocol/http/sampler/HTTPHC4Impl.java#L838
> > >
> > >
> > > We are currently migrating to last 4.5 and would like to know what
> > > is the
> > > clean way to reset SSL State ?
>
> I am not sure I understand what exactly you mean by resetting SSL
> state.
>
> Oleg
>
>
> > > Since httpClient.getConnectionManager() is deprecated.
> > > Should we keep a reference to PoolingHttpClientConnectionManager
> > > and call
> > > those methods on it ?
> > >
> > > Current state of migration is here:
> > >
> > >    - https://github.com/ubikloadpack/jmeter/blob/HC4_
> > >    FULL_MIGRATION/src/protocol/http/org/apache/jmeter/
> > >    protocol/http/sampler/HTTPHC4Impl.java#L973
> > >    <https://github.com/ubikloadpack/jmeter/blob/HC4_FULL_MIGRATION/
> > > src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Im
> > > pl.java#L973>
> > >
> > >
> > > To recap, in JMeter we have 1 HttpClient per User (and this is
> > > needed as
> > > per a previous discussion on this mailing list).
> > >
> > > Thanks for your help.
> > > --
> > > Regards.
> > > Philippe M.
> > >
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

-- 
Cordialement.
Philippe Mouawad.

Re: How to clear SSL State in HC4.5.5

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sat, 2018-03-10 at 14:08 +0100, Philippe Mouawad wrote:
> ...

> > Hello,
> > 
> > In current jmeter trunk when we have Client certificate
> > authentication and
> > we need to reset SSL State so another SSLContext is created we do
> > this:
> > https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/a
> > pache/
> > jmeter/protocol/http/sampler/HTTPHC4Impl.java#L838
> > 
> > 
> > We are currently migrating to last 4.5 and would like to know what
> > is the
> > clean way to reset SSL State ?

I am not sure I understand what exactly you mean by resetting SSL
state.

Oleg


> > Since httpClient.getConnectionManager() is deprecated.
> > Should we keep a reference to PoolingHttpClientConnectionManager
> > and call
> > those methods on it ?
> > 
> > Current state of migration is here:
> > 
> >    - https://github.com/ubikloadpack/jmeter/blob/HC4_
> >    FULL_MIGRATION/src/protocol/http/org/apache/jmeter/
> >    protocol/http/sampler/HTTPHC4Impl.java#L973
> >    <https://github.com/ubikloadpack/jmeter/blob/HC4_FULL_MIGRATION/
> > src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Im
> > pl.java#L973>
> > 
> > 
> > To recap, in JMeter we have 1 HttpClient per User (and this is
> > needed as
> > per a previous discussion on this mailing list).
> > 
> > Thanks for your help.
> > --
> > Regards.
> > Philippe M.
> > 
> > 
> > 
> 
> 

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


Re: How to clear SSL State in HC4.5.5

Posted by Philippe Mouawad <p....@ubik-ingenierie.com>.
Hello,
Any feedback on this ?


Thanks

On Sat, Feb 24, 2018 at 12:24 PM, Philippe Mouawad <
p.mouawad@ubik-ingenierie.com> wrote:

> Hello,
>
> In current jmeter trunk when we have Client certificate authentication and
> we need to reset SSL State so another SSLContext is created we do this:
> https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/
> jmeter/protocol/http/sampler/HTTPHC4Impl.java#L838
>
>
> We are currently migrating to last 4.5 and would like to know what is the
> clean way to reset SSL State ?
> Since httpClient.getConnectionManager() is deprecated.
> Should we keep a reference to PoolingHttpClientConnectionManager and call
> those methods on it ?
>
> Current state of migration is here:
>
>    - https://github.com/ubikloadpack/jmeter/blob/HC4_
>    FULL_MIGRATION/src/protocol/http/org/apache/jmeter/
>    protocol/http/sampler/HTTPHC4Impl.java#L973
>    <https://github.com/ubikloadpack/jmeter/blob/HC4_FULL_MIGRATION/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L973>
>
>
> To recap, in JMeter we have 1 HttpClient per User (and this is needed as
> per a previous discussion on this mailing list).
>
> Thanks for your help.
> --
> Regards.
> Philippe M.
>
>
>


-- 
Cordialement.
Philippe Mouawad.
Ubik-Ingénierie

UBIK LOAD PACK Web Site <http://www.ubikloadpack.com/>

UBIK LOAD PACK on TWITTER <https://twitter.com/ubikloadpack>