如何添加新的SSL连接Spring Boot jks cacerts



我有一个Spring Boot应用程序。我有一个SSL连接的信任库cacerts文件。我用以下命令将其加载到应用程序中:

-Djavax.net.ssl.trustStore="$basedir/cacerts"

现在我需要添加一个新的ssl连接,我有一个key.js文件。如何将其添加到我的应用程序中?

我想我需要把key.js添加到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=

最新更新