aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes SSLHandShakeException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "SSLHandShakeException" Watch "SSLHandShakeException" New topic
Author

SSLHandShakeException

Ashwin B Philar
Greenhorn

Joined: Jun 19, 2002
Posts: 12
Hi!!
This is the first time I am trying to access an HTTPS site using Java.
I installed the latest java sdk1.4.0_01 on my machine.
I downloaded the URLReader.java file from Sun's site and tried to run it, but I am getting the following error:

Exception in thread "main" javax.net.ssl.SSLHandshakeException: Couldn't find trusted certificate
This is the code:
import java.net.*;
import java.io.*;
public class URLReader
{
public static void main(String[] args) throws Exception
{
System.setProperty("https.proxyHost","webproxy");
System.setProperty("https.proxyPort","8080");
URL verisign = new URL("https://www.verisign.com/");
BufferedReader in = new BufferedReader(new
InputStreamReader(verisign.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
Please let me know why I am getting this error.
Thanks
Ashwin
raman
Greenhorn

Joined: Jul 08, 2002
Posts: 2
hi,
when you try to access a site using ssl, the authenticity of the server's certificate is determined on following three parameters:
1. whether the certificate was issued from a trusted certifying authrority.
2. whether the date specified in the certificate valid.
3. the name on the certificate is same as the name of the website you are trying to view.
if you are accessing verisign, the first and third options would be valid. the only thing left is the date. check whether your system date is correct or not.
or try to view the page in a browser, if you get a warning, try to figure out where the problem was.
do let me know if you solved it?
bye
raman
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SSLHandShakeException
 
Similar Threads
url connection query
Connection timeout in URL connection
Networking question
https URLConnection
Accessing HTTPS site using URL