• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 Rjavax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.ibm.jsse2.bm.getPeerCertificateChain(bm.java:52)
at xxxxxxxx.common.StrictSSLProtocolSocketFactory.verifyHostname(Unknown Source)
at xxxxxxxx.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!

Thanks in advanced!
Sunil.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic