dcsimg
Problem in acessing a https site from java.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   rishi_tripathi
Posted On:   Friday, January 24, 2003 09:12 AM

I am working on site testing tool. I am facing problem in accessing our site https://www.deshaw.com from a java program (Using URLConnection). I am getting following exception: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: Could not find trusted certificate at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275) at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA6275) at sun.net.www.protocol.http.HttpURLConnec   More>>

I am working on site testing tool. I am facing problem in accessing our site https://www.deshaw.com from a java program (Using URLConnection). I am getting following exception:



javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: Could not find trusted certificate



at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)
at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA6275)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:574)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(DashoA6275)
at java.net.URL.openStream(URL.java:960)




I am using JDK1.4 and certificate is signed by Verisign.



I am able to access other secured sites like "https://us.etrade.com/e/t/home" and https://banking.raiffeisen.at/html/login.jsp. SSL certificate of these sites are exactly similar to the
certificate of our site https://www.deshaw.com (all signed by Verisign/CPS)and I could not figure out any difference.



After importing the certificate to the JVM it works, but I dont want to do that.



If any body can help me or can tell me what are the possible reasons of this, I would be extremely thankful to him.




Code is very simple.I am opening one URL connection and then reading the content.




URL url = new URL("https://www.deshaw.com");
URLConnection connection = url.openConnection();
InputStream inStream = url.openStream();




Thanks,


Rishi

   <<Less

Re: Problem in acessing a https site from java.

Posted By:   Adam_Gresh  
Posted On:   Thursday, February 27, 2003 10:05 AM

Hi Rishi,


I found a thread discussing this on java.sun.com...


http://forum.java.sun.com/thread.jsp?forum=2&thread=359359


...it discusses how to override the TrustManager which may not be what you're after, but seeing as how you've got so few replies I figured any help might be worthwhile...

About | Sitemap | Contact