Certbot(Let's Encrypt)是一个非盈利性认证机构通过运行互联网安全研究小组(ISRG)提供X.509 证书的传输层安全性不收取任何费用(TLS)加密。证书有效期为90天,在此期间可以随时续订。提供一个自动化流程,旨在克服安全网站的手动创建,验证,签名,安装和续订证书。

Certbot Wiki

前言

因不想在部署环境安装Certbot -> 强迫症 哈哈哈,所以将在其他机子上申请SSL证书(使用手动模式DNS验证) 官方文档

材料

  1. 属于自己的域名(可以修改解析的)。
  2. 可联网的Linux系统(这里是CentOS7)。

安装环境

Certbot包在EPEL中,需要先安装epel-release,再安装certbot

[root@localhost ~]: yum install epel-release -y
…………
[root@localhost ~]: yum install certbot -y
…………

另一种获取Certbot环境的方式(官方文档):

[root@localhost ~]: wget https://dl.eff.org/certbot-auto
[root@localhost ~]: chmod a+x ./certbot-auto

申请SSL证书

certbot certonly --manual --preferred-challenges dns -d 域名

(多个域名就继续加参数-d 域名A -d 域名B

添加域名解析TXT记录。

然后到/etc/letsencrypt/目录下找到对应域名的证书即可。

以下为详细操作步骤:

[root@localhost ~]: certbot certonly --manual --preferred-challenges dns -d www.example.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel):

这里输入一个邮箱(用于紧急更新或安全通知)。

Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: a

这里输入a同意。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: n

如果想接收一些新闻推广之类的邮件就输入y,否则n

Obtaining a new certificate
Performing the following challenges:
dns-01 challenge for www.example.com
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NOTE: The IP of this machine will be publicly logged as having requested this
certificate. If you're running certbot in manual mode on a machine that is not
your server, please ensure you're okay with that.
 
Are you OK with your IP being logged?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: n

这里输入y(必须同意记录IP才会继续处理)。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name
_acme-challenge.www.example.com with the following value:
 
EblBJHP……EUNACE
 
Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue

打开域名解析,添加主机记录_acme-challenge.www,选择记录类型为TXT, 记录值为EblBJHP……EUNACE(给你提供的一段字符串)。

回到CentOS,最好等待几分钟,然后按Enter继续。等待验证。

Waiting for verification...
Cleaning up challenges
Resetting dropped connection: acme-v02.api.letsencrypt.org
 
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/www.example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/www.example.com/privkey.pem
Your cert will expire on 2019-06-22. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
…………

这里提示证书、私钥保存的位置以及证书的有效期。

删除证书及配置信息

[root@localhost ~]: certbot delete
[root@localhost ~]: rm -rf /etc/letsencrypt/accounts/*

附2

本机站点根目录的验证方式

[root@localhost ~]: certbot certonly --webroot -w /opt/web -d www.example.com

更多Certbot命令选项

附3

7天之内每个域名地址最多只能成功申请5个哟。查看更多限制

附4

证书续期(这个不在限制范围内的哦)

[root@localhost ~]: certbot renew

Certbot为域名申请免费SSL证书的更多相关文章

  1. [从零开始搭网站六]为域名申请免费SSL证书(https),并为Tomcat配置https域名所用的多SSL证书

    点击下面连接查看从零开始搭网站全系列 从零开始搭网站 由于国内的网络环境比较恶劣,运营商流量劫持的情况比较严重,一般表现为别人打开你的网站的时候会弹一些莫名其妙的广告...更过分的会跳转至别的网站. ...

  2. 让网站永久拥有HTTPS - 申请免费SSL证书并自动续期 Let’s Encrypt

    让网站永久拥有HTTPS - 申请免费SSL证书并自动续期 Let’s Encrypt 为什么要用HTTPS  网站没有使用HTTPS的时候,浏览器一般会报不安全,而且在别人访问这个网站的时候,很有可 ...

  3. 最新阿里云申请免费SSL证书实现网站HTTPS化(图文教程一)

    一.申请免费SSL证书: 1.登录阿里云: 2.领取代金券礼包: https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=0a ...

  4. 阿里云申请免费SSL证书,并配置到Tomcat,实现https访问

    第一步:阿里云免费https证书安装  https://jingyan.baidu.com/article/fdffd1f8619481f3e98ca196.html 第二步:阿里云申请免费SSL证书 ...

  5. 物联网架构成长之路(20)-申请免费SSL证书

    0.前言 今天域名备案申请下来了,接下来就是申请个SSL证书,现在普通的网站没有SSL都不好意思见人了.可是稍微好点的企业级SSL证书还是比较贵的.不过还好有免费的可以用.只不过要定时去续时间.这个不 ...

  6. windows下 申请免费ssl证书的方法 (letsencrypt)

    Let's Encrypt,官网是https://letsencrypt.org/,它是一个由各大公司赞助的公益组织: 有趋势有需求,自然也有免费可用.免费的SSL证书中,首推就是Let's Encr ...

  7. 阿里云免费申请免费SSL证书

    随着互联网的不断进步与发展,对于网站与数据的安全性要求也越来越高,原本的HTTP明文传输已经不被信任,https逐渐被关注,从谷歌.火狐浏览器将对HTTP明文页面标记"不安全",到 ...

  8. Let's Encrypt申请免费SSL证书

    1.https的作用 安全,防止网站被劫持,数据被修改 2.Let's Encrypt是什么 Let's Encrypt是一个证书授权机构(CA),可以从Let's Encrypt获得网站域名的免费证 ...

  9. 腾讯云服务器申请免费SSL证书,实现Https。

    1.首先在腾讯云的SSL证书管理中申请免费的SSL.审核速度还是挺快的... 2.按照步骤申请后,就可以下载主流web服务器的证书了.如图: 3.这里我使用的web服务器是nginx,把nginx下的 ...

随机推荐

  1. Asp.Net Core 2.0 项目实战(6)Redis配置、封装帮助类RedisHelper及使用实例

    本文目录 1. 摘要 2. Redis配置 3. RedisHelper 4.使用实例 5. 总结 1.  摘要 由于內存存取速度远高于磁盘读取的特性,为了程序效率提高性能,通常会把常用的不常变动的数 ...

  2. 图解HTTPS建立过程

    阅读目录 准备工作(对应图中prepare1234) 发起链接 最后 关于网络安全加密的介绍可以看之前文章: 1. 网络安全——数据的加密与签名,RSA介绍2. Base64编码.MD5.SHA1-S ...

  3. ETCD相关介绍--整体概念及原理方面

    etcd作为一个受到ZooKeeper与doozer启发而催生的项目,除了拥有与之类似的功能外,更专注于以下四点. 简单:基于HTTP+JSON的API让你用curl就可以轻松使用. 安全:可选SSL ...

  4. FPGA学习笔记(二)——FPGA学习路线及开发流程

    ###### [该随笔部分内容转载自小梅哥]       ######### 一.FPGA学习路线 工具使用 -> 语法学习 -> 逻辑设计 -> IP使用 ->接口设计 -& ...

  5. jQuery学习之旅 Item6 好用的each()

    1.javascript 函数的调用方式 首先来研究一下jquery的each()方法的源码,在这之前,先要回顾一下javascript函数具体调用样式: 普通函数调用 setName(); 可以作为 ...

  6. bzoj3289 Mato的文件管理 莫队+树状数组

    求逆序对个数,莫队套树状数组 #include<cstdio> #include<iostream> #include<cstring> #include<c ...

  7. LOJ_6045_「雅礼集训 2017 Day8」价 _最小割

    LOJ_6045_「雅礼集训 2017 Day8」价 _最小割 描述: 有$n$种减肥药,$n$种药材,每种减肥药有一些对应的药材和一个收益. 假设选择吃下$K$种减肥药,那么需要这$K$种减肥药包含 ...

  8. linux文件的基本属性

    Linux 文件基本属性 Linux系统是一种典型的多用户系统,不同的用户处于不同的地位,拥有不同的权限.为了保护系统的安全性,Linux系统对不同的用户访问同一文件(包括目录文件)的权限做了不同的规 ...

  9. Sublime Text3插件安装(经典)

    今天我去听数学建模的培训,感觉很有意思,可是我没有报名(QAQ),没有参加培训的报名,不过幸好没有开始选拔比赛 所以我决定学习数学建模方面的知识,要好好学习了! 希望我未来的学弟学妹们!(不要像我这样 ...

  10. 实验吧 ---- 隐写术之so beautiful so white

    因为好久没有写博客,所以今天本宝宝要弥补这个过错,一下子更新许多文章,希望各位小伙伴能够原谅,以后我会加倍努力的! 这一次主要都是实验吧里面的 关于隐写术方面的知识,后续我会上传一些解密工具,希望能够 ...