首页 > 解决方案 > keystore password incorrect in Spring boot SSL

问题描述

I generate my keystore as follows:

keytool -genkeypair -alias applocaldata -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore applocaldata.p12 -validity 3650

my spring boot config looks as follows:

server:
  address: apps.companyname.local
  port: 8443
  ssl:
    key-store-type: JKS
    key-store:  classpath:applocaldata.p12
    key-store-provider: SUN
    key-password: password
    key-alias: applocaldata
    enabled: true
    trust-store: classpath:applocaldata.p12
    trust-store-password: password
    trust-store-provider: SUN

I keep getting the error at the start:

[...]
Caused by: java.lang.IllegalArgumentException: keystore password was incorrect
[...]

I can use the same password with:

keytool -list -v -keystore applocaldata.p12

and I can see the keystore data. What might I be doing wrong in Spring boot? Exactly the same happens when I generate a jks keystore.

标签: spring-bootssl

解决方案


推荐阅读