收到StartSSL的邮件通知证书快到期了,加上前段时间说StartSSL把服务器放到Qihoo了;刚好换上Let’s Encrypt
官方推荐的工具(Let’s Encrypt Client):https://github.com/certbot/certbot
https://github.com/diafygi/acme-tiny 这个客户端比官方的轻多了,比较了下决定用这个。
1.Create a Let’s Encrypt account private key
openssl genrsa 4096 > account.key
2.Create a certificate signing request (CSR) for your domains.
NOTE: you can’t use your account private key as your domain private key!
openssl genrsa 4096 > domain.key
|
|
报错:
cat: /etc/ssl/openssl.cnf: No such file or directory
unable to find ‘distinguished_name’ in config
problems making Certificate Request
140168944265032:error:0E06D06C:configuration file routines:NCONF_get_string:no value:conf_lib.c:335:group=req name=distinguished_name
把OpenSSL的配置文件换成存在的路径,例如:/etc/pki/tls/openssl.cnf
3.Make your website host challenge files
mkdir -p /data/www/challenges/
修改vhost配置文件:
|
|
nginx -s reload
4.Get a signed certificate!
|
|
5.Install the certificate
|
|
|
|
6.Setup an auto-renew cronjob (自动续签,有效期只有90天)
将
|
|
移到https段
|
|
增加定时脚本:
|
|
crontab -e or vi /etc/crontab
|
|