nginx 使用自签名证书

openssl自签名证书

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

posted @ 2019-11-10 03:06  Carry00  阅读(221)  评论(0编辑  收藏  举报