我有一个 Spring Boot 应用程序。我有一个用于 SSL 连接的信任库 cacerts 文件。我使用以下命令将其加载到应用程序中:
-Djavax.net.ssl.trustStore="$basedir/cacerts"
现在我需要添加一个新的 ssl 连接,我有一个 key.jks 文件。如何将其添加到我的应用程序中?我以为我需要将 key.jks 添加到 cacerts 文件中,但是使用 keytool 添加它时出现异常
Input non a x.509 certificate
最佳答案
您必须使用以下应用程序属性配置您的 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=
# The path to the keystore containing the certificate
server.ssl.key-store=classpath:cacerts
# The password used to generate the certificate
server.ssl.key-store-password=
# The alias mapped to the certificate
server.ssl.key-alias=
关于java - 如何添加新的 SSL 连接 Spring Boot jks cacerts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64721380/