current position:Home>HTTP becomes HTTPS, self-made certificate

HTTP becomes HTTPS, self-made certificate

2022-04-29 15:17:14WuWuII

winodw In the environment cmd Generate

Generate p12


keytool -genkey -alias Alias -storetype Keystore type -keyalg Algorithm -keysize How many -keystore certificate -validity Effective time


D:\>keytool -genkey -alias wzw -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore wzw.p12 -validity 3650

After execution, you will be asked to fill in some information , region 、 Name or something , Can not fill
Generated in the current directory , Here it is D Disk execution , So in D disc
 Insert picture description here
Check it out. , Display the contents of the certificate
 Insert picture description here

springboot Use in

Copy p12 To project , I put it in resources Next , Modify the configuration file

# The name of the certificate you generated 
# Keystore password 
# Key type 
# Alias 

Because it's a self-made Certificate , So show insecure connections , Just click to continue the visit
 Insert picture description here

JKS certificate

keytool -genkey -alias wzw -keypass 123456 -keyalg RSA -keysize 1024 -validity 3650 -keystore wzw.keystore -storepass wzw


pfx turn jks

keytool -importkeystore -srckeystore -srcstoretype pkcs12 -destkeystore wzw.jks -deststoretype JKS

## See aliases

keytool -list -v -keystore wzw.p12

They are self-made certificates , If you need secure certificate access , You can go to the service provider to buy and download , You can also have a restricted and secure certificate access :, The second method of connection , You can refer to

copyright notice
author[WuWuII],Please bring the original link to reprint, thank you.

Random recommended