• 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

SSLHandShakeException

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
For my next trick, I'll need the help of a tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic