【问题标题】:Spring boot enable Https : SSL Keystore ErrorSpring Boot 启用 Https:SSL 密钥库错误
【发布时间】:2020-08-31 14:57:41
【问题描述】:

我正在尝试在我的 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 

【问题讨论】:

    标签: spring spring-boot keystore jks


    【解决方案1】:

    您缺少密钥密码。

    server.ssl.key-password=yourpasswordhere

    【讨论】:

      猜你喜欢
      • 2017-01-27
      • 2020-08-25
      • 2022-01-14
      • 2018-08-18
      • 2018-10-09
      • 2015-11-08
      • 1970-01-01
      • 2020-01-29
      • 2015-09-13
      相关资源
      最近更新 更多