Basic knowledge of computer network (8) - how to make an SSL certificate in HTTPS? Hands-on teaching

I learned what is the HTTPS protocol earlier, and briefly understood the related concepts of the SSL/TLS protocol. Among them, the most critical point in the S in HTTPS is "public key and private key", so now let's learn how to make a "public key && private key"

insert image description here

The process of using OPENSSLto generate a self-signed certificate is as follows, the following google.comdomain names can be used freely, but when replacing, the domain names in each instruction must be replaced with the same

  1. generate private key

    openssl genrsa -out google.com.key 2048
    

insert image description here

  1. Generate CSR (Certificate Signing)

    openssl req -new -out google.com.csr -key google.com.key
    

insert image description here

  1. Generate a self-signed certificate

    openssl x509 -req -in google.com.csr -out google.com.cer -signkey google.com.key -CAcreateserial -days 36500
    

insert image description here

  1. Generate server CRT format certificate

    openssl x509 -inform PEM -in google.com.cer -out google.com.crt
    

insert image description here

  1. Generate PEM public key

    openssl x509 -in google.com.crt -outform PEM -out google.com.pem
    

insert image description here

  1. *.PEM & *.KEYThe two suffix files are the final public key and private key that need to be used

insert image description here

Guess you like

Origin blog.csdn.net/qq_44299067/article/details/130993668