【问题标题】:Getting SSLhandshake exception even after the security certificate is installed即使在安装了安全证书后也出现 SSLhandshake 异常
【发布时间】:2012-04-20 07:29:56
【问题描述】:

" java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法 找到请求目标的有效认证路径”

我在尝试通过 jwebuint 程序连接到网站时遇到上述异常。我已经导入了证书 keytool 命令。

我在这里被击中了。 请帮帮我。 谢谢..

【问题讨论】:

    标签: jakarta-ee jwebunit


    【解决方案1】:
    1. 使用调试标志运行 (-Djavax.net.debug=ssl,handshhake)
    2. 您是否向 JVM 指示密钥库/信任库的正确位置? (javax.net.ssl.keyStore, javax.net.ssl.trustStore, javax.net.ssl.keyStorePassword)

    【讨论】:

    • @hanu:只需使用这些选项 -Dparameter=value 运行您的程序。调试选项将打开详细信息。同时运行你的程序:java -Djavax.net.debug=ssl,handshhake -Djavax.net.ssl.trustStore=trustedcerts.jks com.example.MyClass
    【解决方案2】:

    谢谢大家..

    解决方法:会有两个JRE——一个在jdk1.2...下,第二个直接在java文件夹下。 您需要在您的IDE安装的JRE中的jre下使用keytool命令安装或导入网站安全证书

    对于 Eclipse IDE: 去windows->preferences->安装jre的 然后它会告诉你安装的jre的路径。

    您需要将证书导入该特定 jre..

    使用keytool命令如下: C:\Program Files\Java\jre6\bin>keytool -import -alias aliasname -keystore ..\lib\security\cacerts -file "D:\Softwares\certificates\mycert.cer"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-07
      • 2017-05-09
      • 1970-01-01
      • 1970-01-01
      • 2020-10-18
      • 1970-01-01
      • 2019-12-13
      • 2016-04-09
      相关资源
      最近更新 更多