![](/img/trans.png)
[英]lotus notes ssl certificate self signed client no trusted certificate java
[英]Trusted SSL certificate showing as self signed
我有一个由 DigiCert 提供的受信任的 TLS 证书,我试图在暴露 rest api 的 java/spring 应用程序中使用它。
我使用 openssl 创建了 a.p12 文件,执行以下操作: openssl pkcs12 -export -in mycertificate.cer -certfile mycertificate_INTERMEDIATE.cer -inkey myprivate_key.key -out myCert.p12
我可以在我的应用程序中使用此文件通过 https 使用以下配置 (application.properties) 访问应用程序:
server.port:8443
server.ssl.key-store-type=PKCS12
server.ssl.key-store=classpath:myCert.p12
server.ssl.key-store-password=mypass
但是,当访问我的应用程序时(通过 postman 例如在https://localhost:8443/api/auth上)我有一个错误,表明我正在使用自签名证书。
我的理解是,由于我使用的是受信任的证书,因此我不应该收到此错误消息。
创建我在我的应用程序中使用的.p12 文件时我是否遗漏了一些东西,或者我的假设是否错误?
您不应该使用 localhost 访问 URL(肯定您没有提供 CN 作为 localhost)。
请使用您在生成证书时作为 CN 参数提供的主机名访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.