ssl 自签证书

生成证书对
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private.key -out /etc/ssl/cert.crt

Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:BJ
Locality Name (eg, city) [Default City]:BJ
Organization Name (eg, company) [Default Company Ltd]:KS
Organizational Unit Name (eg, section) []:BLOG
Common Name (eg, your name or your server’s hostname) []:blog.mobro.site
Email Address []:[email protected]

生成Diffie-Hellman Params
sudo openssl dhparam -out /etc/ssl/dhparam.pem 2048
nginx 配置
ssl on;
ssl_certificate /etc/ssl/cert.crt;
ssl_certificate_key /etc/ssl/private.key;
ssl_dhparam /etc/ssl/dhparam.pem;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

原文链接: https://shimo.im/docs/5QaOedbfyKsa5vsr/read


学海无涯苦作舟,你要学的东西还多着呢。 一一 《将夜》

你可能感兴趣的:(tech,借鉴优秀文章)