This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes javax.net.ssl.SSLException: untrusted server cert chain Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "javax.net.ssl.SSLException: untrusted server cert chain" Watch "javax.net.ssl.SSLException: untrusted server cert chain" New topic
Author

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

Ron Summer
Greenhorn

Joined: Feb 05, 2010
Posts: 8
Hi All,
I hope I can get some help with the above error. The background is I have two different URL's connections( A and B) in my application. They both call a different secured server requesting data. The error below is always returned when the second request is being made. If I run request A first the request completes fine. But when I run the B request the error occurs. The flip side is when I shut the application down and re-run with the B request first the request completes fine, but the A request produces the error. Both A and B sessions are on their own Thread that terminates after breaking the requested file into usable parts.

I'm not sure if it's relevant or not but in the (A)(B)Connection properties sslSocketFactory has an array of http: sites that has been requested. It continues to grow with each new request and it does not matter which class I look at the Connection properites. I am wondering it their is a way to reset that array or move items form the list? At this point I'm not even sure if it's relevant.

Thanks for any and all help.

The stack trace it produces is as:

javax.net.ssl.SSLException: untrusted server cert chain
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.OutputStream.write(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.doConnect(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.NetworkClient.openServer(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.l(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.<init>(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.<init>(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getOutputStream(DashoA12275)


Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
Though may not be related, any particular reason you explicitly adding a provider and using the default one.


Thanks and Regards
Ron Summer
Greenhorn

Joined: Feb 05, 2010
Posts: 8

If I don't add the com.sun.net.ssl.internal.ssl.Provider provider I get an error of no SSL implementation.

Any other suggestions comments? This one has really got me puzzled.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.net.ssl.SSLException: untrusted server cert chain
 
Similar Threads
Authentication web services
Getting data from a URL.
URL https connection problems, please help!!!
Untrusted server cert chain ?
Connect to UPS HTTPS/ssl server for Rates Web Service