1. 创建自定义数字证书,打开命令行提示符
2.输入如下代码,其中“d:/creat/”是你存放生成数字证书的地方,需要提前建立对应文件夹
keytool -genkeypair -alias springboot-https -keypass 123456 -keyalg RSA -keysize 2048 -validity 365 -keystore d:/creat/springboot.keystore -storepass 123456
执行结果如下图,询问的信息可以随便填
会出现一个这样的警告,需要更改一下证书密钥库的格式才可以。
Warning:
JKS 密钥库使用专用格式。建议使用 "keytool -importkeystore -srckeystore d:/creat/springboot.keystore -destkeystore d:/creat/springboot.keystore -deststoretype pkcs12" 迁移到行业标准格式 PKCS12。
输入如下代码:
keytool -importkeystore -srckeystore d:/creat/springbo