That worked very well. Thanks a lot.
> On Mon, 2013-11-11 at 12:48 -0500, Ray Williams Robinson Valiente wrote:
>> Hi:
>>
>> I understand how risky this could be but, is there some way to simply
>> trust in any SSL certificate when using HttpClient 4.3.1 over https
>> URLs,
>> without including deprecated classes/functionalities? I working on some
>> sort of spider Java program and I certainly need to accept all SSL
>> certificates, no matter they nature.
>>
>
> Try this
>
> ---
> SSLContext sslcontext = SSLContexts.custom()
> .loadTrustMaterial(null, new TrustStrategy() {
> @Override
> public boolean isTrusted(
> final X509Certificate[] chain,
> final String authType) throws CertificateException {
> return true;
> }
> }).build();
> CloseableHttpClient client = HttpClients.custom()
> .setSslcontext(sslcontext)
> .build();
> ---
>
> Oleg
>
>
>
--
Eng. Ray Williams Robinson Valiente
Base Technologies Group
DESOFT, Havana Division
Phone: (+537)8356362
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]