ssl PKIX路径验证失败:java.security.cert.CertPathValidatorException:名称约束检查失败

ht4b089n  于 5个月前  发布在  Java
关注(0)|答案(1)|浏览(108)

服务到服务API通信时出现以下错误。证书已导入Java密钥库。
[错误]:GET请求“www.example.com“时出现I/O错误https://url.com/data-api/customer:PKIX路径验证失败:java.security.cert.CertPathValidatorException:名称约束检查失败;嵌套异常为javax.net.ssl.SSLHandshakeException:PKIX路径验证失败:java.security.cert.CertPathValidatorException:名称约束检查失败

pgx2nnw8

pgx2nnw81#

我自己解决了这个问题。我不得不将应用程序URL SSL证书导入到Java密钥库。这在开发和分期环境中是不需要的,尽管SSL证书在所有环境中都使用。我很高兴这个问题在导入证书后得到了解决。

keytool -importcert -file ./prod.cer -cacerts -keypass <password> -storepass <password> -noprompt -alias prod-cert

字符串

相关问题