This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.net.ssl.SSLException: untrusted server cert chain  RSS feed

 
vikram veera
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying connect to webserver using https from apche HttpClient.
I created keystore and placed in server. The same configured in server.xml too. If I am invoking through browser its working fine. but if i try to invoke through HttpClient its throwing following exception. Pls help me in this regards.


at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(DashoA12275)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA12275)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:67)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:125)
at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:827)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1975)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
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(HttpClient.java:324)
at test.SSLTest.main(SSLTest.java:36)

My Client code snipet is

HttpClient httpclient = new HttpClient();
java.security.Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider());


PostMethod httpget = new PostMethod("myurl"); //servlet url
try {
httpclient.executeMethod(httpget);
System.out.println(httpget.getStatusLine());
} catch(Exception e){
System.out.println(" Exception "+e);
e.printStackTrace();
}finally {
httpget.releaseConnection();
}
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!