传统的为 Spring Boot 配置SSL/TLS证书一般都会把证书打包成 JKS
(Java KeyStore) 或 PKCS12
(Public Key Cryptographic Standards) 格式,然后为Spring Boot 增加以下类似配置:
# The format used for the keystore. It could be set to JKS in case it is a JKS file
server.ssl.key-store-type=PKCS12
# The path to the keystore containing the certificate
server.ssl.key-store=classpath:keystore/baeldung.p12
# The password used to generate the certificate
server.ssl.key-store-password=xxxxxxx
# The alias mapped to the certificate
server.ssl.key-alias=example_com
但很多时候我们拿到的是 PEM
(Privacy Enhanced Mail)格式的证书和私钥,