【发布时间】:2014-11-06 22:36:10
【问题描述】:
我有一个启用 Spring Security 的 Web 应用程序,它使用部署在 WLP 上的 SSL 连接到 LDAP。我在jvm.options 文件中指定了如下信任库和密码
-Djavax.net.ssl.trustStore=path/to/keystore
-Djavax.net.ssl.trustStorePassword=password
我的server.xml 如下所示
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>ssl-1.0</feature>
<feature>localConnector-1.0</feature>
</featureManager>
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" httpsPort="9443" />
<keyStore id="defaultKeyStore" location="/path/to/identity.jks" password="password" provider="SUN" />
<webContainer deferServletLoad="false" />
<application id="appId" location="/path/to/app.war" name="app" type="war" />
</server>
但是我得到以下异常
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
我用一个独立的 java 程序尝试了相同的信任存储,它可以工作。任何帮助表示赞赏。
注意:如果我在 identity.jks 中包含受信任的 CA,它会起作用
谢谢 壁画
【问题讨论】:
-
请使用“-Djavax.net.debug=all”运行以获得完整的 SSL 调试日志,并在此处粘贴问题。
-
有什么理由不能使用 identity.jks 来存储受信任的 CA?
-
我希望它有所不同,因为服务器证书是从外部获得的,并且 CA 证书是所有环境的标准。但看起来我必须使用一个密钥库选项。
标签: java ssl websphere websphere-liberty