This discussion is archived
2 Replies Latest reply: Jun 7, 2009 11:01 PM by 843810 RSS

JAVA HELP problem with SSL

843810 Newbie
Currently Being Moderated
Hi dears,

Is any one connected to java help using SSL ?

Our application Help link does not work when we try to connect to it via SSL (https) it gave us following exception, while there is no problem with http.

I will appreciate it if any one can help me.

Regards,
Elham

===============Exception ERROR
Got an IOException (sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target)
Parsing failed for null

Message was edited by:
elham
  • 1. Re: JAVA HELP problem with SSL
    843810 Newbie
    Currently Being Moderated
    Hi Dears,

    We finally solved the problem.
    First of all we add the server´┐Żs certificate to the keyStore by using "InstallCert" program. (Which is extremely helpful) It generates a "jssecacerts" file , then we copied this file under JAVA_HOME/jre/lib/security folder.
    For more information on this part please visit http://blogs.sun.com/andreas/entry/no_more_unable_to_find

    After that we "get java.io.IOException: HTTPS hostname wrong: should be <localhost>" and to fix this we use following function to verify our hostname and call it before opening the connection to the server (I put it in first line of my help.jsp file.)for more information on this part please visit http://forum.java.sun.com/thread.jspa?threadID=521779&tstart=105
    public static void  verifyHostname(){
            HostnameVerifier hv = new HostnameVerifier() {
                public boolean verify(String urlHostName, SSLSession session) {
                    log.warn("Warning: URL Host: "+urlHostName+" vs. "+session.getPeerHost());
                    return true;
                }
            };
            HttpsURLConnection.setDefaultHostnameVerifier(hv);
        }
    Cheers,
    Elham
  • 2. Re: JAVA HELP problem with SSL
    843810 Newbie
    Currently Being Moderated
    Ours is a web application i.e. our server is running somewhere and we are connecting to the same through browser (IE or Mozila). Our application works fine in Http and Https.

    But after integrating Java help 2.0, it works fine in http, but for https it displays the following exception and the application frame does not open.

    The exception is:
    500 Could not parse Got an IOException (sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested

    When I have googled it, there are some links which claims that have found solution to it by importing the certificate on the client side (this one too).

    But my problem is that it is not a soap application or a normal application in which have control; here my browser is connecting to the server.

    The server might have the certificate and the browser has imported the certificate, that's why it is not giving me the certificate error but after importing the same, the help is not working and it is giving me the above error.

    Either I am not getting what they are suggesting or they are refering to some other problem that is different from mine.

    But the problem is that I am not getting anywhere on this? I am new to jsp or web application but I have extensive exp. in java application dev.

    I have already spent day and half on it; please help.

    Edited by: ragoel on Jun 7, 2009 10:57 PM