mac apache ssl 配置nginx
a-生成私鑰,命令: sudo openssl genrsa -des3 -out app.key 1024apache
b-生成簽署申請,命令: sudo openssl req -new -key app.key -out app.csr服務器
c-生成服務器的私鑰,命令: sudo openssl rsa -in app.key -out server.keyapp
d-生成給網站服務器簽署的證書,命令: sudo openssl req -new -x509 -days 3650 -key server.key -out server.crt網站
nginx 配置 自簽名 sslserver
mkdir /usr/local/etc/nginx/sslssl
cd sslopenssl
#openssl genrsa -des3 -out server.key 1024配置
#openssl req -new -key server.key -out server.csrrsa
#openssl rsa -in server.key -out server_nopwd.key
#openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt
server {
listen 443;
ssl on;
ssl_certificate /usr/local/etc/nginx/ssl/server.crt;
ssl_certificate_key /usr/local/etc/nginx/ssl/server_nopwd.key;
}