我把这张证书安装了,但是系统还是提示没有根证(javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: Could not find trusted certificate),怎样不对这张证书做出验证,直接使用?

解决方案 »

  1.   

    你要把“https://127.0.0.1”的证书导入到java默认的trust store文件中
      

  2.   

    您好,能告诉我具体的方法吗?https://www.paypal.com/,https://www.test.com
    等等每个访问的错误都不一样,有的是证书过期,有的是无效证书链,我将下载的证书直接安装,应该是放到系统的csp中还不行吗?能不能给我一个具体的步骤
      

  3.   

    你可以用ie访问相应的站点,然后查看他的证书,把根证书保存到一个文件中a.cer,然后
    在%java_home%\jre\lib\security目录下执行
    keytool -import -noprompt -keystore cacerts -storepass changeit -alias entry1 -file a.cer
    keytool.exe在%java_home%\bin下,参数的含义你可以看一下它的帮助。
      

  4.   

    还是不行,我把用户证书,和上级ca的根证都导进去了阿javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: Could not find trusted certificate
      

  5.   

    导入到%jre_home%\lib\security\cacerts中试一下
      

  6.   

    how to? 难道前面的不是导入到cacerts?
      

  7.   

    能不能麻烦您给个程序访问的配置步骤?
    下面这个访问时提示“javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: CA certificate does not include basic constraints extension”import org.apache.commons.httpclient.*;
    import org.apache.commons.httpclient.cookie.CookiePolicy;
    import org.apache.commons.httpclient.methods.*;public class  UserCertTest
    {
    public static void main(String[] args) 
    {
        try
    {
    System.out.println("start");
    HttpClient client = new HttpClient();
    GetMethod redirect = new GetMethod("https://www.verisign.com/");
    client.executeMethod(redirect);
    System.out.println(redirect.getStatusLine().toString());
    }catch(Exception e)
    {
    System.out.println(e.toString());
    }
    }
    }
      

  8.   

    %jre_home%在你的program files目录下,而不是%jdk_home%下那个jre目录
      

  9.   

    又有新问题,现在get没有什么问题,但是使用post的时候,会出现“ INFO [main] (HttpMethodDirector.java:423) - I/O exception caught when processing request: Unrecognized SSL message, plaintext connection?