sh 生成带有2行的自签名证书

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 生成带有2行的自签名证书相关的知识,希望对你有一定的参考价值。

ssl_certificate   /etc/nginx/ssl/star_localhost.crt;
ssl_certificate_key /etc/nginx/ssl/star_localhost.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';

# Add perfect forward secrecy
ssl_prefer_server_ciphers on;

# Add HSTS
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
openssl req -new -newkey rsa:2048 -nodes -out star_localhost.csr -keyout star_localhost.key -subj "/C=BG/ST=Sofia/L=Sofia/O=Amon/OU=Marketing/CN=*.localhost"
openssl x509 -req -days 365 -in star_localhost.csr -signkey star_localhost.key -out star_localhost.crt

以上是关于sh 生成带有2行的自签名证书的主要内容,如果未能解决你的问题,请参考以下文章

sh 这是一个shell脚本,用于自动生成https托管站点的自签名证书。

带有 Python SSL 套接字的自签名证书

sh 基本的自签名SSL证书实用程序

sh 基本的自签名SSL证书实用程序

sh 笔记:OpenSSL生成「自签名」证书,配置Nodejs本地HTTPS服务 - 2.生成.csr

验证设备的自签名证书