apache - 太阳.security.provider.certpath.SunCertPathBuilderException : unable to find valid certification path to requested target

标签 apache ssl keytool

我在 Apache Tomcat 7 上有一个 Web 应用程序,我的 Web 应用程序上有不受信任的证书。我的 Web 应用程序必须与另一个使用 https 的 Web 应用程序通信。但是我总是得到这个异常(exception):

Failed to make connection: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

我从另一个应用程序的浏览器下载 crt 文件,并导入到我的 tomcat 服务器的 jks keystore 中。

这是来自 server.xml 文件的配置:

<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLSv1.2" keystoreFile="/opt/apache/apache-tomcat-7.0.55-test/conf/portalnew.jks"  keystorePass="changeit" keyAlias="portalnew"/>

当我输入时

keytool -list -v -keystore portalnew.jks

我可以看到我添加的crt文件。

另外,我在 cacerts.jks 中添加了 crt 文件

最佳答案

我通过在 cacerts 中添加 .crt 文件来修复它,而不是在 cacerts.jks 中

关于apache - 太阳.security.provider.certpath.SunCertPathBuilderException : unable to find valid certification path to requested target,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41460313/

相关文章:

apache - 在目标中使用带有 HTTP_HOST 的 RedirectMatch

linux - Chrome 上的 ERR_SSL_VERSION_INTERFERENCE

ssl - 带有 SSL/TLS 错误 : Unable to load server key file 的 MQTT 服务器

java - 通过 CLI 根据 Java 证书库验证证书

java - keytool 证书生成 appeats 卡在命令行

linux - 使用 Apache 访问文档根目录之外的文件

apache - 到 Apache 2.4.4 和 Tomcat 7.0.33。通过 HTTPS 访问网站产生 “Object not found” 错误

javascript - Web 套接字 - 服务器负载

python - 有人可以详细解释一下这段代码是如何工作的(使用 Python 访问 Web 数据)

android - 查找已签名应用的 key 哈希