Code Comments
Programming Forum and web based access to our favorite programming groups.The following code works when ran as:
java -Dhttps.proxyHost=myproxyHost.com -Dhttps.proxyPort=8080
URLReader
public class URLReader {
public static void main(String[] args) throws Exception {
String authentication = "Basic " + new
sun.misc.BASE64Encoder().encode("myid:mypassword".getBytes());
URL verisign = new URL("https://www.thawte.com");
HttpURLConnection con = (HttpURLConnection)
verisign.openConnection();
con.setRequestProperty("Proxy-Authorization", authentication);
BufferedReader in = new BufferedReader(
new InputStreamReader(
con.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
However, when I change the host to https://www.verisign.com, it gives
the following exception:
Exception in thread "main" javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate
found
When I turn the debug on I see the following:
keyStore is :
keyStore type is : jks
init keystore
init keymanager of type SunX509
trustStore is: D:\Sun\AppServer\jdk\jre\lib\security\ca
certs
trustStore type is : jks
init truststore
How can I add a verisign certificate to the key store that will make
the program work?
Thank You..
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.