The Artima Developer Community
Sponsored Link

Java Answers Forum
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorExcept

2 replies on 1 page. Most recent reply: Aug 28, 2003 8:22 AM by Patrick Boisclair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Stephen Huey

Posts: 10
Nickname: stephen
Registered: Aug, 2003

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorExcept Posted: Aug 11, 2003 1:01 PM
Reply to this message Reply
Advertisement
I'm trying to interact with an HTTPS website from within my Java application (neither applet nor server-side). I've followed the instruction in the following PDF to use Java's keytool program to import the site's certificate into my keystore:
http://www.infy.com/knowledge_capital/thought-papers/usingHTTPwith_java.pdf

However, this didn't seem to change ANYTHING. I still get that exception! Any ideas?


David

Posts: 150
Nickname: archangel
Registered: Jul, 2003

Re: javax.net.ssl.SSLHandshakeExce ption: sun.security.validator.Valida torExcept Posted: Aug 12, 2003 4:35 AM
Reply to this message Reply
Can you post the complete message? I'm assuming you have a valid account on the server....

Patrick Boisclair

Posts: 4
Nickname: pboisclair
Registered: Aug, 2003

Re: javax.net.ssl.SSLHandshakeExce ption: sun.security.validator.Valida torExcept Posted: Aug 28, 2003 8:22 AM
Reply to this message Reply
I have followed the indications from the PDF you suggested and it worked for our situation. We are using JAVA SDK 1.4.2 for Windows. This release include JSSE 1.0.3.

I saved the server certificate using IE in the jre\lib\security folder. Then I used keytool to import the certificate information in cacerts.

This is code I used to send/receive the request. I do not know if I need everything in there, but it works and it is something to start with:
public void sendRequest  ( )
{
if ( responseFileName.trim( ).length( ) == 0)
    {
    responseFileName = requestFileName + ".out.xml" ;
    }
 
try
    {
    //    Construct the request connection to service
 
    System.setProperty("java.protocol.handler.pkgs", 
        "com.sun.net.ssl.internal.www.protocol" ) ;
 
    URL
        url = new URL ( serviceUrl );
 
    URLConnection
        urlConnection = (URLConnection) url.openConnection();
 
    urlConnection.setDoInput(true);
    urlConnection.setDoOutput(true);
 
    OutputStream
        requestOutputStream = urlConnection.getOutputStream();
 
    writeFileToStream ( requestOutputStream ) ;
 
    requestOutputStream.close();
 
    //    Get ready to read the response
 
    InputStream
        responseInputStream = null;
 
    try
        {
        responseInputStream = urlConnection.getInputStream();
        }
    catch (Exception e)
        {
        displayResponse ( urlConnection ) ;
        return;
        }
 
    displayResponse ( urlConnection ) ;
    writeStreamToFile ( responseInputStream ) ;
    }
catch (Throwable e)
    {
    e.printStackTrace();
    }
}


Let me know if it helped!!

Flat View: This topic has 2 replies on 1 page
Topic: Java I/O Problem.(Thanks!) Previous Topic   Next Topic Topic: Improving Applet Performance

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use