1.建立網站證書存放目錄 shell> mkdir /usr/local/nginx/conf/ssl shell> cd /usr/local/nginx/conf/ssl 2.製做CA證書 shell> openssl genrsa -des3 -out ca.key 2048 shell> openssl req -new -x509 -days 7305 -key ca.key -out ca.crt 3.生成nginx服務器所需證書,並用CA簽名 shell> openssl genrsa -des3 -out client.key 1024 shell> openssl req -new -key client.key -out client.csr shell> openssl x509 -req -in client.csr -out client.pem -signkey client.key -CA ca.crt -CAkey ca.key -CAcreateserial -days 3650 4.查看證書文件 shell> pwd /usr/local/nginx/conf/ssl shell> ls ca.crt ca.key ca.srl client.csr client.key client.pemip 在加載SSL支持的Nginx並使用上述私鑰時除去必須的口令:
- $ cp client.key client.key.org
- $ openssl rsa -in client.key.org -out client.key
|