This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
Water proof donuts! Eat them while reading this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic