1.安装
git clone git://github.com/Neilpang/acme.sh.git
cd ./acme.sh
./acme.sh --install
2. 使用 DNSPod.cn domain API 。
登陆DNSPod控制台--用户中心--安全设置--创建API Token
export DP_Id="你的API Token ID"
export DP_Key="你的API Token"
添加2行到 ~/.acme.sh/account.conf.
3.生成证书
./acme.sh --issue --dns dns_dp -d '*.fsyz.com.cn'
[2018年 5月 7日 星期一 12时29分56秒 CST] Your cert is in ~/.acme.sh/*.fsyz.com.cn/*.fsyz.com.cn.cer
[2018年 5月 7日 星期一 12时29分56秒 CST] Your cert key is in ~/.acme.sh/*.fsyz.com.cn/*.fsyz.com.cn.key
[2018年 5月 7日 星期一 12时29分56秒 CST] The intermediate CA cert is in ~/.acme.sh/*.fsyz.com.cn/ca.cer
[2018年 5月 7日 星期一 12时29分56秒 CST] And the full chain certs is there: ~/.acme.sh/*.fsyz.com.cn/fullchain.cer
./acme.sh --issue --dns dns_dp -d '*.fsyz.net'
[2018年 5月 7日 星期一 12时32分54秒 CST] Your cert is in ~/.acme.sh/*.fsyz.net/*.fsyz.net.cer
[2018年 5月 7日 星期一 12时32分54秒 CST] Your cert key is in ~/.acme.sh/*.fsyz.net/*.fsyz.net.key
[2018年 5月 7日 星期一 12时32分54秒 CST] The intermediate CA cert is in ~/.acme.sh/*.fsyz.net/ca.cer
[2018年 5月 7日 星期一 12时32分54秒 CST] And the full chain certs is there: ~/.acme.sh/*.fsyz.net/fullchain.cer
4.安装到指定目录
./acme.sh --installcert -d '*.fsyz.com.cn' --keypath /usr/local/etc/nginx/ssl/fsyz.com.cn.key --fullchainpath /usr/local/etc/nginx/ssl/fullchain.com.cer
[2018年 5月 7日 星期一 12时33分32秒 CST] Installing key to:/usr/local/etc/nginx/ssl/fsyz.com.cn.key
[2018年 5月 7日 星期一 12时33分32秒 CST] Installing full chain to:/usr/local/etc/nginx/ssl/fullchain.com.cer
./acme.sh --installcert -d '*.fsyz.net' --keypath /usr/local/etc/nginx/ssl/fsyz.net.key --fullchainpath /usr/local/etc/nginx/ssl/fullchain.net.cer
[2018年 5月 7日 星期一 12时34分11秒 CST] Installing key to:/usr/local/etc/nginx/ssl/fsyz.net.key
[2018年 5月 7日 星期一 12时34分11秒 CST] Installing full chain to:/usr/local/etc/nginx/ssl/fullchain.net.cer
5.nginx配置
ssl_certificate /usr/local/etc/nginx/ssl/fullchain.com.cer;
ssl_certificate_key /usr/local/etc/nginx/ssl/fsyz.com.cn.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains' always;
ssl_prefer_server_ciphers on;
6.https://www.ssllabs.com/ssltest/index.html测试: