1.生成私钥
$ openssl genrsa -out blog.key 2048
2.生成 CSR (Certificate Signing Request)
$ openssl req
-subj "/C=CN/ST=Tianjin/L=Tianjin/O=Mocha/OU=Mocha Software/CN=test1.sslpoc.com/emailAddress=test@mochasoft.com.cn"
-new
-key blog.key
-out blog.csr
3.生成自签名证书
$ openssl x509
-req
-days 3650
-in blog.csr
-signkey blog.key
-out blog.crt