« Return to Thread: how to ignore ssl certificate error

Re: how to ignore ssl certificate error

by Milind W :: Rate this Message:

Reply to Author | View in Thread

Thanks Ahmed that worked like a charm.

For future reference if someone wants to do the same thing its fairly
straight forward.

1)Create a package called
org.apache.commons.httpclient.contrib.ssl
add the two files.
EasySSLProtocolSocketFactory.java
EasyX509TrustManager.java
Compile.

2)Add the following lines of code to your htmlclient before making any
htmlunit calls

Protocol easyhttps = new Protocol("https", new
EasySSLProtocolSocketFactory(), 443);
Protocol.registerProtocol("https", easyhttps);

-Milind

>From: Ahmed Ashour <asashour@...>
>Reply-To: htmlunit-user@...
>To: htmlunit-user@...
>Subject: Re: [Htmlunit-user] how to ignore ssl certificate error
>Date: Thu, 11 Oct 2007 12:24:59 -0700 (PDT)
>
>I believe there is no already built jar, but if you go to:
>http://jakarta.apache.org/httpcomponents/httpclient-3.x/sslguide.html
>
>there is a link to:
>
>http://svn.apache.org/viewvc/jakarta/httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java?view=markup
>
>From which you can get the source of two .java, then compile yourself.
>
>Many thanks,
>Ahmed
>
>
>
>____________________________________________________________________________________
>Be a better Heartthrob. Get better relationship answers from someone who
>knows. Yahoo! Answers - Check it out.
>http://answers.yahoo.com/dir/?link=list&sid=396545433


>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc.
>Still grepping through log files to find problems?  Stop.
>Now Search log events and configuration files using AJAX and a browser.
>Download your FREE copy of Splunk now >> http://get.splunk.com/


>_______________________________________________
>Htmlunit-user mailing list
>Htmlunit-user@...
>https://lists.sourceforge.net/lists/listinfo/htmlunit-user



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

 « Return to Thread: how to ignore ssl certificate error