commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <adrian.sut...@ephox.com>
Subject RE: [httpclient] using SSL, https connection
Date Tue, 18 Mar 2003 23:44:29 GMT
Hi,

This looks like it may well be a problem with HttpClient, but I can't be
sure at the moment.  What I think is happening is that when the URL is
redirected, HttpClient attempts to use a secure socket.  Could you take a
look at http://jakarta.apache.org/commons/httpclient/logging.html and
provide the log output with HttpClient set to "trace" level and wire trace
enabled.  Some useful pointers for trouble shooting HttpClient are available
at http://jakarta.apache.org/commons/httpclient/troubleshooting.html but I'd
be fairly confident that it's a bug.

As a work around, you could turn off HttpClient's follow redirect feature
(see the HttpMethod interface and setFollowRedirects I think) then handle
the redirect yourself by creating a new method with the redirect URL.
Instructions on how to handle redirects manually are available at:
http://jakarta.apache.org/commons/httpclient/redirects.html  Definitely
provide the log though so that we can evaluate whether or not we need to fix
the problem in HttpClient.

I knew writing all that documentation would pay off eventually. :)  Let me
know if there's anything I can provide more info on etc.

Regards,

Adrian Sutton, Software Engineer
Ephox Corporation
www.ephox.com


-----Original Message-----
From: MATHIEU Benoit 028900 ASSISTEC [mailto:MATHIEUB@ZOE.CEA.FR]
Sent: Tuesday, 18 March 2003 5:56 PM
To: 'commons-user@jakarta.apache.org'
Subject: [httpclient] using SSL, https connection


Hi,

I am trying to connect to a https url which is redirected to a non secure
http url. When I connect to the same url with my browser, I am redirected
automatically (after secure dialog boxes). When I use httpclient, I always
get the following exception. How could deal with this exception ?

javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: Couldn't find trusted certificate
	at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
	at
org.apache.commons.httpclient.HttpConnection.write(HttpConnection.java:693)
	at
org.apache.commons.httpclient.HttpConnection.write(HttpConnection.java:652)
	at
org.apache.commons.httpclient.HttpConnection.print(HttpConnection.java:772)
	at
org.apache.commons.httpclient.HttpMethodBase.writeRequestLine(HttpMethodBase
.java:2060)
	at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.jav
a:1971)
	at
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j
ava:2298)
	at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:915
)
	at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:557)
	at
fr.cea.lic2m.idre.wedor.JakartaWebSession.connectToURL(JakartaWebSession.jav
a:75)
	at
fr.cea.lic2m.idre.webmodule.requests.GRInit.execute(GRInit.java:48)
	at
fr.cea.lic2m.idre.webmodule.WebRequest.execute(WebRequest.java:72)
	at fr.cea.lic2m.idre.frag.Agent.run(Agent.java:38)
Caused by: java.security.cert.CertificateException: Couldn't find trusted
certificate
	at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.a(DashoA6275)
	at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(DashoA6
275)
	at
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(DashoA6
275)
	... 19 more

Is there a manual about how to use SSL and Httpclient ? Does anyone have any
suggestion ?

thanks,
BM


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message