sh 为Nginx #ssl #nginx创建自签名SSL证书

Posted

tags:

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

#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024

echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr

echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
rm myssl.key.org

echo "Generating certificate..."
openssl x509 -req -days 365 -in myssl.csr -signkey myssl.key -out myssl.crt

echo "Copying certificate (myssl.crt) to /etc/ssl/certs/"
mkdir -p  /etc/ssl/certs
cp myssl.crt /etc/ssl/certs/

echo "Copying key (myssl.key) to /etc/ssl/private/"
mkdir -p  /etc/ssl/private
cp myssl.key /etc/ssl/private/

以上是关于sh 为Nginx #ssl #nginx创建自签名SSL证书的主要内容,如果未能解决你的问题,请参考以下文章

nginx自签ssl证书

nginx和iis下的SSL双向认证教程【ca 自签 ssl证书】

sh 为Nginx #ssl #nginx创建自签名SSL证书

NGINX 配置 SSL 双向认证

sh nginx SSL

sh nginx ssl