我已经创建了一个密钥库。首先,我下载了证书:
$ openssl s_client -connect vault.ra-sec.svc:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt
然后我创建密钥库:
$ keytool -import -alias vault.ra-sec.svc -keystore keystore.jks -file public.crt
所以:
$ keytool -list -keystore keystore.jks
Enter keystore password:
Keystore type: PKCS12
Keystore provider: SUN
Your keystore contains 1 entry
vault.ra-sec.svc, Jul 10, 2018, trustedCertEntry,
Certificate fingerprint (SHA-256): F1:41:A1:E3:E5:DD:66:F6:D3:6A:FE:54:81:D5:18:C0:93:B8:8F:66:AE:CF:D1:AA:A4:85:9B:62:DD:97:C8:D1
启动弹簧靴时,出现以下异常消息:
意外错误:java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空;否则为false。嵌套异常是javax.net.ssl.SSLException:java.lang.RuntimeException:意外错误:java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空
有什么想法吗?