微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

春季启动启用Https:SSL密钥库错误

如何解决春季启动启用Https:SSL密钥库错误

我正在尝试在我的Spring Boot应用程序中启用https,但是收到“密钥库被篡改或密码错误”的错误。以下是我的应用程序属性文件中的以下配置。

server.port=8083
server.ssl.enabled=true
server.ssl.key-store-type=JKS
server.ssl.key-store=C:\\Users\\abc.jks
server.ssl.key-store-password=C:\\Users\\password.txt

However when i am using TomcatServletWebServerFactory to redirect http to https with the below configuration in application properties it works fine without any issue. application starts on http 8081 and https 8083 ports.

server.port=8083
http.server.port= 8081
server.ssl.enabled=true
server.ssl.key-store-type=JKS
server.ssl.key-store=C:\\Users\\abc.jks
server.ssl.key-store-password=C:\\Users\\password.txt


    

I am not able to find root cause and resolve the issue. Please help me to find out what i am doing wrong. 

**Spring boot : 2.3.2.RELEASE
tomcat-embed-core-9.0.37.jar:9.0.37
jdk1.8.0_111**

下面是错误

[AsyncReporter{org.springframework.cloud.sleuth.zipkin2.sender.RestTemplateSender@355ce6a6}] but has Failed to stop it. This is very likely to create a memory leak. Stack trace of thread: 
Caused by: java.lang.IllegalArgumentException: standardService.connector.startFailed 
Caused by: org.apache.catalina.LifecycleException: Protocol handler start Failed 
Caused by: java.lang.IllegalArgumentException: Keystore was tampered with,or password was incorrect 
Caused by: java.io.IOException: Keystore was tampered with,or password was incorrect 
Caused by: java.security.UnrecoverableKeyException: Password verification Failed 

解决方法

您缺少关键密码。

server.ssl.key-password=yourpasswordhere

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。