SSL 设置春季启动 [英] SSL settings spring boot

查看:44
本文介绍了SSL 设置春季启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Spring Boot 中的 ssl 有一些疑问.我有扩展名为 .crt 和 .key 的文件认证和私钥.我怎样才能从他们那里获得正确的 spring boot 设置格式

I have some questions about ssl in spring boot. I have files certifications and private key with extension .crt and .key. how can I get from them right format for settings in spring boot like this

    server.ssl.key-store-type=PKCS12
    server.ssl.key-store=classpath:keystore.p12
    server.ssl.key-store-password=password 
    server.ssl.key-alias=tomcat

推荐答案

要将证书文件和私钥转换为 PKCS#12(.p12) 格式,请使用以下命令:

To convert a certificate file and private key to PKCS#12(.p12) format, use the below command:

openssl pkcs12 -export -out certificate.p12 -inkey privateKey.key -in certificate.crt -certfile CACert.crt

请查看以下链接,以供您在 Spring Boot 中处理 https 时参考.

Please go through the below links for your reference on dealing with https in spring boot.

  1. 在 Spring Boot 中启用 HTTPS
  2. 在 Spring Boot 中配置 HTTP 到 HTTPS 的重定向

这篇关于SSL 设置春季启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆