Let's encrypt 制作证书

简介

免费的证书制作工具。

安装

备注
操作系统 CentOS-7.5
内核 3.10
主机域名 www.siguadantang.com

依赖python和git,关于python的安装详细参见 python安装手册,关于git的安装详情参见 git安装手册

 # yum install git
  $ mkdir -p /app/soft/encrypt
  $ cd /app/soft/encrypt
  $ git clone https://github.com/letsencrypt/letsencrypt
  $ cd letsencrypt
  $ ./certbot-auto certonly --standalone -d siguadantang.com -d www.siguadantang.com

  $ Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): smhwzf@163.com

  $ (A)gree/(C)ancel: A
  $ (Y)es/(N)o: Y

结果

 IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/siguadantang.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/siguadantang.com/privkey.pem
   Your cert will expire on 2019-02-04. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again. To non-interactively renew *all* of your certificates, run
   "certbot-auto renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

更新证书

执行更新命令

 $ ./certbot-auto certonly --renew-by-default --email smhwzf@163.com -d siguadantang.com -d www.siguadantang.com

选择安装类型

 How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Apache Web Server plugin (apache)
2: Spin up a temporary webserver (standalone)
3: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-3] then [enter] (press 'c' to cancel): 3

选择目录

 Plugins selected: Authenticator webroot, Installer None
 Renewing an existing certificate
 Performing the following challenges:
 http-01 challenge for siguadantang.com
 http-01 challenge for www.siguadantang.com
 Input the webroot for siguadantang.com: (Enter 'c' to cancel): /var/www/html

确认目录

Select the webroot for www.siguadantang.com:


1: Enter a new webroot 2: /var/www/html


Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2 Waiting for verification... Cleaning up challenges

结果

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/siguadantang.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/siguadantang.com/privkey.pem
   Your cert will expire on 2019-05-02. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again. To non-interactively renew *all* of your certificates, run
   "certbot-auto renew"

  证书根目录:
    /etc/letsencrypt/live/siguadantang.com

  文件
    ca.pem
    cert.pem -> ../../archive/siguadantang.com/cert2.pem
    chain.pem -> ../../archive/siguadantang.com/chain2.pem
    fullchain.pem -> ../../archive/siguadantang.com/fullchain2.pem
    privkey.pem -> ../../archive/siguadantang.com/privkey2.pem
    README


结语