Hello list,

I'm writing a web spider using HttpCore 4.0.1 as the HTTP protocol handler. I want to implement SSL support and I'm having some trouble.

Right now I have included only a single line of code to implement SSL:

schemes.register(new Scheme(PROTOCOL_HTTPS, SSLSocketFactory.getSocketFactory(), 443));

This works, sort of, except that it doesn't allow the program to talk SSL using untrusted certificates. Since my program is a spider I don't actually care about security, the spider will never send anything of value to a webserver anyway. So I want to configure the socket factory to always accept all certificates and SSL setup stuff no matter how fucked up it might be.

Reading through the javadoc I found the following SSLSocketFactory constructor:

new SSLSocketFactory(TrustStrategy customTrustStrategy)

So I thought I could use this with a TrustStrategy of my own:

public CustomTrustStrategy implements TrustStrategy
{
  public boolean isTrusted(X509Certificate[] chain, String authType)
  {
    return true;
  }
}

Unfortunately, this constructor doesn't exist in version 4.0.1 and version 4.1 is still in beta. Is there another way that I can accomplish what I want using HttpCore 4.0.1 and also is what I'm doing even the right way to do what I want?

Thanks,
Jurgen Voorneveld

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to