Re: HTTPS testing
"Wolfgang Fahl - BITPlan" <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Organization | bitplan GmbH |
| Message-ID | <[email protected]> |
Dear Eric, you are welcome to submit httpunit compatible testcase code to show how in the httpunit environment this should work. I'll happily work together with you on this issue. Yours Wolfgang From: Eric Jablow <[email protected]> To: Discussion of use and development of HttpUnit <httpunit- [email protected]> Date sent: Fri, 28 Mar 2008 18:26:07 -0400 Subject: Re: [Httpunit-develop] HTTPS testing Send reply to: Discussion of use and development of HttpUnit <httpunit- [email protected]> <httpunit-develop.lists.sourceforge.net> <mailto:[email protected]?subject=unsubscribe> <mailto:[email protected]?subject=subscribe> > What I'd like is the ability to apply an arbitrary set of client X.509 > certificates to my connections. In pseudocode, it would be like > > @Test > public void testSuperuser() throws Exception { > > X509Certificate supercert = certificate(SUPER_USER); > HttpClient httpclient = new HttpClient(); > httpclient.getHostConfiguration().setProxy("myproxyhost", 8080); > httpclient.getState().setClientCertificate(supercert); > GetMethod httpget = new GetMethod("https://example.com/"); > try { > httpclient.executeMethod(httpget); > // assert response code = 200. > } finally { > httpget.releaseConnection(); > } > } > @Test > public void testUnauthorizeduser() throws Exception { > > X509Certificate unauthcert = certificate(UNAUTHORIZED_USER); > HttpClient httpclient = new HttpClient(); > httpclient.getHostConfiguration().setProxy("myproxyhost", 8080); > httpclient.getState().setClientCertificate(unauthcert); > GetMethod httpget = new GetMethod("https://example.com/"); > try { > httpclient.executeMethod(httpget); > // assert response code == 401. > } finally { > httpget.releaseConnection(); > } > } > > If I need to play with socket factories, I'll learn how. > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Httpunit-develop mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/httpunit-develop BITPlan - smart solutions Pater-Delp-Str. 1, D-47877 Willich-Schiefbahn Tel. +49 1805 - BITPLAN / +49 1805 248 752, Fax +49 2154 811-481 Web: http://www.bitplan.de bitplan GmbH, Willich - HRB 6820 Krefeld, VAT-ID: 10258040584, Geschäftsführer: Wolfgang Fahl Mit BITPlan effizient zum Erfolg: http://www.bitplan.de ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace