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 Will McQueen <wi...@yahoo.com> on 2009/02/10 02:12:56 UTC
Self-signed certs and a replacement for EasySSLProtocolSocketFactory
Hi,
For testing in stage environment, I'm using EasySSLProtocolSocketFactory to create an SSL Socket that accept self-signed certificates. But HttpClient 3.1 docs say that this method is deprecated. Is there a replacement class (either in HttpClient 3.1 or 4.0) that achieves the same goal?
Thank you.
Cheers,
Will
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: Self-signed certs and a replacement for EasySSLProtocolSocketFactory
Posted by Will McQueen <wi...@yahoo.com>.
Thanks, Olivier. That info will be useful for when we move to HttpClient 4.0.
I was wrong about the EasySSLProtocolSocketFactory being deprecated (HttpClient 3.1)... the deprecated member is actually the Protocol constructor that takes a SecureProtocolSocketFactory. The other constructor is not deprecated, so I just performed the appropriate cast:
Protocol easyhttps = new Protocol("https", (ProtocolSocketFactory)new EasySSLProtocolSocketFactory(), 443);
Protocol.registerProtocol("https", easyhttps);
That seems to be the way to do it in v3.1...
Cheers,
Will
--- On Tue, 2/10/09, Olivier Lamy <ol...@apache.org> wrote:
> From: Olivier Lamy <ol...@apache.org>
> Subject: Re: Self-signed certs and a replacement for EasySSLProtocolSocketFactory
> To: "HttpClient User Discussion" <ht...@hc.apache.org>, willmcqueen@yahoo.com
> Date: Tuesday, February 10, 2009, 12:30 AM
> Hi,
> You can have a look at the continuum code which do this
> with httpclient 4.x. [1]
> Line with comment :
> // https scheme
> schemeRegistry.register( new Scheme(
> "https", new
> EasySSLSocketFactory(), 443 ) );
>
> HTH,
> --
> Olivier
> [1]
> https://svn.apache.org/repos/asf/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
>
> 2009/2/10 Will McQueen <wi...@yahoo.com>:
> >
> > Hi,
> >
> > For testing in stage environment, I'm using
> EasySSLProtocolSocketFactory to create an SSL Socket that
> accept self-signed certificates. But HttpClient 3.1 docs say
> that this method is deprecated. Is there a replacement class
> (either in HttpClient 3.1 or 4.0) that achieves the same
> goal?
> >
> > Thank you.
> >
> > Cheers,
> > Will
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail:
> httpclient-users-help@hc.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail:
> httpclient-users-help@hc.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: Self-signed certs and a replacement for EasySSLProtocolSocketFactory
Posted by Olivier Lamy <ol...@apache.org>.
Hi,
You can have a look at the continuum code which do this with httpclient 4.x. [1]
Line with comment :
// https scheme
schemeRegistry.register( new Scheme( "https", new
EasySSLSocketFactory(), 443 ) );
HTH,
--
Olivier
[1] https://svn.apache.org/repos/asf/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
2009/2/10 Will McQueen <wi...@yahoo.com>:
>
> Hi,
>
> For testing in stage environment, I'm using EasySSLProtocolSocketFactory to create an SSL Socket that accept self-signed certificates. But HttpClient 3.1 docs say that this method is deprecated. Is there a replacement class (either in HttpClient 3.1 or 4.0) that achieves the same goal?
>
> Thank you.
>
> Cheers,
> Will
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org