到 http://www.wosign.com/Products/free_SSL.htm 申請免費的SSL證書。node
下載www.iamle.com.zip文件,解壓文件,找到for Nginx.zip解壓,獲得2個文件nginx
1_www.iamle.com_bundle.crt ,2_www.iamle.com.key瀏覽器
改個名字www.iamle.com.crt,www.iamle.com.key傳到服務器上備用服務器
找到對應的serversession
增長spa
listen 443 ssl; ssl on; ssl_certificate /usr/local/nginx/conf/ssl/www.iamle.com.crt; ssl_certificate_key /usr/local/nginx/conf/ssl/www.iamle.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on;
從新載入nginx配置.net
[root@do ssl]# /etc/init.d/nginx reloadserver
瀏覽器信任的https://www.iamle.com 已經可用了~htm
若是已經有一個擴展名爲pfx的證書,那麼須要轉換使用ip
[root@do ~]# openssl pkcs12 -in www.iamle.com.pfx -nocerts -nodes -out www.iamle.com.key Enter Import Password: 輸入證書密碼 MAC verified OK [root@do ~]# openssl pkcs12 -in www.iamle.com.pfx -clcerts -nokeys -out www.iamle.com.crt Enter Import Password: 輸入證書密碼 MAC verified OK
生成2個文件 www.iamle.com.key , www.iamle.com.pfx 複製到你指定的目錄