2020/4/8-证书转换pfx-cer

证书转换transfer the format of certificate from pfx to pem

get the key: 

openssl pkcs12 -in test.crt.pfx -nocerts  -nodes -out privatekey.pem

get the cert:  

openssl pkcs12 -in test.crt.pfx -nokeys -out cert.pem

查看证书有效期:

openssl x509 -in cert.pem -noout -dates
notBefore=Apr 9 10:56:53 2021 GMT
notAfter=Mar 16 17:37:09 2036 GMT

3、配置nginx

    ssl_certificate /usr/local/nginx/XXX.crt;
    ssl_certificate_key /usr/local/nginx/XXX.rsa;
    ssl_session_timeout 10m;
    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

4、重启nginx

5、谷歌浏览器可以很方便看到你的证书生效、失效日期哦
————————————————
版权声明:本文为CSDN博主「benjor_ming」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_39585596/article/details/107442301

 

posted @ 2021-04-08 17:39  FengR  阅读(208)  评论(0编辑  收藏  举报