生成jks文件然后验证

生成jks文件然后验证

我使用以下命令从远程服务器生成了密钥库文件::

openssl s_client -showcerts -connect esesslx0833.se:9443 > /tmp/test.cer

keytool -importcert -file /tmp/test.cer -keystore qpid.jks -alias "Alias1"

现在我已成功生成此文件,我想通过启动到远程节点的 SSL 连接来测试它,以确保我的qpid.jks文件有效。

有没有办法可以使用标准 Linux 命令进行测试?因为当我在应用程序中使用 jks 文件时,我收到错误 ::

Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)[:1.8.0_121]
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)[:1.8.0_121]
    at sun.security.validator.Validator.validate(Validator.java:260)[:1.8.0_121]
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)[:1.8.0_121]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:281)[:1.8.0_121]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:136)[:1.8.0_121]
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1501)[:1.8.0_121]
    ... 21 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

相关内容