On 15 April 2011 17:08, Sunil Linga <[email protected]> wrote:
>
> Hello All,
>
> I am getting below exception while connecting to an URL over SSL using
> httpclient 3 from our application running on WAS 6 and j2sdk 1.4.
>
> [4/15/11 11:16:15:103 EDT] 00000038 SystemErr     R
> javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
>             at com.ibm.jsse2.bm.getPeerCertificateChain(bm.java:52)
>             at
> funb.eprofile.common.StrictSSLProtocolSocketFactory.verifyHostname(Unknown
> Source)
>             at
> funb.eprofile.common.StrictSSLProtocolSocketFactory.createSocket(Unknown
> Source)
>             at
> org.apache.commons.httpclient.HttpConnection.tunnelCreated(HttpConnection.java:785)
>             at
> org.apache.commons.httpclient.HttpMethodDirector.executeConnect(HttpMethodDirector.java:513)
>             at
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:390)
>             at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
>             at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
>             at org.apache.commons.httpclient.HttpClient.executeMethod(
>
> Strangely, the same piece of code is working fine when ran as a stand alone
> outside the application.
>
> Below is the code snippet I am using..
>
> StrictSSLProtocolSocketFactory stricthttps = new
> StrictSSLProtocolSocketFactory(true);
> stricthttps.setDN("CN=***, OU=***, OU=***, OU=***, O=***, C=***,
> SERIALNUMBER=***");
> Protocol.registerProtocol("https", new Protocol("https",
> (ProtocolSocketFactory)stricthttps, Integer.parseInt("443")));
> HttpClient httpclient = new HttpClient();
> httpclient.getHostConfiguration().setProxy(host, port);
> httpreq  = new PostMethod("https://xxxx.com/contextpath";);
> StringRequestEntry myString = new StringRequestEntry(message);
> httpreq.setRequestEntity(myString);
>
> httpclient.execteMethod(httpreq);
>
> Any help in this is greatly appreciated!

StrictSSLProtocolSocketFactory is not a Commons HttpClient class, so
we cannot help you here.

I suggest you ask the providers of the class what the error means.

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

Reply via email to