Re: Changing the SSL socket factory for https:// URLs

"Wolfgang Fahl" <[email protected]> Fri, 21 Aug 2009 14:44:38 +0200
Newsgroups gmane.comp.web.httpunit.devel
Organization BITPlan GmbH
Message-ID <[email protected]>
Dear Florian,

thank you for your proposal.
http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1053


has the function as a static functon of 
HttpProtocolSupport. I've also added a simple test case 
that only runs it and checks that the result is not 
null.

May be you were intending to put it elsewhere. Just let 
me know where it should go. For testing the SSL stuff we 
might need to setup an SSL Server with certificates 
somewhere on the internet. These tests would need to be 
specifically turned on, since all other tests don't need 
a server on the internet or locally. 

Yours
  Wolfgang
> > Excellent. I've been looking for a solution for this for 
> > a long time. Please bare with me if it will take a few 
> > days before the changes show up in subversion.
> 
> Thanks.  For completeness, here's how to create a socket factory which
> uses an anything-goes trust manager:
> 
>     public SSLSocketFactory getSocketFactory() throws Exception {
> 	final SSLContext context = SSLContext.getInstance("TLS");
> 	context.init(null, new X509TrustManager[] {
> 		new X509TrustManager() {
> 		    @Override
> 		    public void checkClientTrusted(X509Certificate[] arg0,
> 			    String arg1) throws CertificateException {
> 		    }
> 
> 		    @Override
> 		    public void checkServerTrusted(X509Certificate[] arg0,
> 			    String arg1) throws CertificateException {
> 		    }
> 
> 		    @Override
> 		    public X509Certificate[] getAcceptedIssuers() {
> 			return null;
> 		    }
> 
> 		}}, null);
> 	return context.getSocketFactory();
>     }
> 
> This could be added as a convenience method.
> 
> -- 
> Florian Weimer                <[email protected]>
> BFK edv-consulting GmbH       http://www.bfk.de/
> Kriegsstraße 100              tel: +49-721-96201-1
> D-76133 Karlsruhe             fax: +49-721-96201-99
> 



BITPlan - smart solutions
Pater-Delp-Str. 1, D-47877 Willich Schiefbahn
Tel. +49 2154 811-480, Fax +49 2154 811-481
Web: http://www.bitplan.de
bitplan GmbH, Willich - HRB 6820 Krefeld, VAT-ID: 10258040548, 
Geschäftsführer: Wolfgang Fahl

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop