1.首先确认你的证书不再需要,如果有必要,请执行下面的命令进行备份

cp /etc/letsencrypt/ /etc/letsencrypt.backup -r

2.撤销证书然后删除证书

[root@localhost certbot-0.34.2]# certbot revoke    ####这个是撤销命令,执行这命令下面会报错要让我指定变量位置
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error! Exactly one of --cert-path or --cert-name must be specified!
You have new mail in /var/spool/mail/root
[root@localhost certbot-0.34.2]# certbot revoke --cert-path /etc/letsencrypt/archive/pazzn.com/c
cert1.pem cert2.pem chain1.pem chain2.pem
[root@localhost certbot-0.34.2]# certbot revoke --cert-path /etc/letsencrypt/archive/pazzn.com/cert
cert1.pem cert2.pem
[root@localhost certbot-0.34.2]# certbot revoke --cert-path /etc/letsencrypt/archive/pazzn.com/cert1.pem ###撤销这个cert1.pem证书,一般默认都是我这个位置
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you like to delete the cert(s) you just revoked, along with all earlier
and later versions of the cert?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es (recommended)/(N)o: y ##确定撤销
[root@localhost certbot-0.34.2]# certbot delete ###删除证书
Saving debug log to /var/log/letsencrypt/letsencrypt.log Which certificate(s) would you like to delete?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: pazzn.com-0001
2: pazzn.com-0002
3: pazzn.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Deleted all files relating to certificate pazzn.com-0001.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You have new mail in /var/spool/mail/root
[root@localhost certbot-0.34.2]# certbot delete
Saving debug log to /var/log/letsencrypt/letsencrypt.log Which certificate(s) would you like to delete?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: pazzn.com-0002
2: pazzn.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Deleted all files relating to certificate pazzn.com-0002.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[root@localhost certbot-0.34.2]# certbot delete
Saving debug log to /var/log/letsencrypt/letsencrypt.log Which certificate(s) would you like to delete?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: pazzn.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Deleted all files relating to certificate pazzn.com.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[root@localhost certbot-0.34.2]# certbot delete ###删除完后再次执行就会说没有证书文件了,根据自己需要删除域名指定证书
Saving debug log to /var/log/letsencrypt/letsencrypt.log
No existing certificates found.
[root@localhost certbot-0.34.2]# certbot revoke
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error! Exactly one of --cert-path or --cert-name must be specified!
You have new mail in /var/spool/mail/root

3.弄完证书后还得删除在nginx.conf配置文件中的ssl配置内容,不然没有了证书,一般就报404什么的了,所以一定要删除

删除后记得重启nginx服务,网页就撤销证书了。

[root@localhost ~]# systemctl restart nginx.service
[root@localhost ~]#

最后如图已经撤销:

参考链接:https://www.jesusamieiro.com/remove-revoke-a-domain-in-lets-encrypt/

Let’s Encrypt/Certbot移除/remove/revoke不需要的域名证书的更多相关文章

  1. 高效率遍历Map以及在循环过程中移除 remove指定key

    //高效率遍历Map以及在循环过程中移除 remove指定key //使用iter循环的时候 可以在循环中移除key,for在循环的过程中移除会报错哦 //本方法效率高 Iterator iter = ...

  2. 免费SSL证书Let's Encrypt(certbot)安装使用教程

    免费SSL证书Let's Encrypt(certbot)安装使用教程 https://www.vpser.net/build/letsencrypt-certbot.html

  3. let's encrypt部署免费泛域名证书

    环境说明 [root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) [root@localhos ...

  4. 基于Let's Encrypt生成免费证书-支持多域名泛域名证书

    目录 客户端 certbot acme.sh 安装acme.sh 1. 自动安装 2. 手动安装 3. 测试收否安装成功 使用acme.sh生成证书 1. HTTP 方式 2. DNS 方式 1. 生 ...

  5. CentOS 7配置Let’s Encrypt支持免费泛域名证书

    Let’s Encrypt从2018年开始支持泛域名证书,有效期3个月,目前仅支持acme方式申请,暂不支持certbot. 1.安装acme.sh curl https://get.acme.sh ...

  6. 申请 Let’s Encrypt 泛域名证书 及 Nginx/Apache 证书配置

    什么是 Let’s Encrypt? 部署 HTTPS 网站的时候需要证书,证书由 CA (Certificate Authority )机构签发,大部分传统 CA 机构签发证书是需要收费的,这不利于 ...

  7. Let's Encrypt免费泛域名证书申请

    一. 下载acme.sh,以下四条命令任选一条即可 curl https://get.acme.sh | shwget -O - https://get.acme.sh | sh curl https ...

  8. STL - 移除(remove)和释放(erase)集合元素

    remove(移除): 这个操作并不是真正地删除元素,它会移除指定的元素,然后后面的元素依次前移,最后用别的元素来补充. erase(释放): 这个操作会指定释放区间的头和尾迭代器(iterator) ...

  9. Java - ArrayList List 等迭代集合执行移除(remove) 的正确方法

    方法1: List<String> al = new ArrayList<String>(); Iterator<String> it = al.iterator( ...

随机推荐

  1. iOS 14 YYAnimatedImageView加载图片失败处理

    1.问题出在YYAnimatedImageView源码一个方法中 - (void)displayLayer:(CALayer *)layer { if (_curFrame) { layer.cont ...

  2. 安装篇八:配置 Nginx 使其支持 MySQL 应用

    配置说明 (让nginx  MySQL(中间件)之间建立关系) 第一个里程: 编写nginx.php首页文件 第二个里程:重启nginx 第三个里程:访问网页测试 打开浏览器访问:http://47. ...

  3. 创建txt文件,并且写入内容

    使用fopen的w方式就可以创建一个新的txt文件,如果文件名存在该文件内容会消失. 1. fopen的函数原型:FILE * fopen(const char * path,const char * ...

  4. 【超级经典】程序员装B指南(转)

    一.准备工作   "工欲善其事必先利其器." 1.电脑不一定要配置高,但是双屏是必须的,越大越好,能一个横屏一个竖屏更好.一个用来查资料,一个用来写代码.总之要显得信息量很大,效率 ...

  5. 基于Python的接口自动化实战-基础篇之pymysql模块操作数据库

    引言 在进行功能或者接口测试时常常需要通过连接数据库,操作和查看相关的数据表数据,用于构建测试数据.核对功能.验证数据一致性,接口的数据库操作是否正确等.因此,在进行接口自动化测试时,我们一样绕不开接 ...

  6. 如何解决Visual Studio 首次调试 docker 的 vs2017u5 exists, deleting Opening stream failed, trying again with proxy settings

    前言 因为之前我电脑安装的是windows10家庭版,然而windows10家庭没有Hyper-v功能. 搜索了几篇windows10家庭版安装docker相关的博客,了解一些前辈们走过的坑. 很多人 ...

  7. String被final修饰

    源码:

  8. git版本回滚

    本地版本回滚 git reset --hard <版本号> (git log 可查看版本号,版本号不用写全) 远程仓库版本回滚 先在本地将版本回滚 ,然后git push -f 强制提交

  9. Redis缓存篇(三)缓存污染

    上一讲介绍了缓存满了,通过内存淘汰机制来淘汰掉数据.如果有的数据一直滞留在缓存中,但又没有应用使用,时间长了,就可能会占据大部分的缓存空间. 今天我们来学习一下缓存污染,以及如何解决缓存污染. 缓存污 ...

  10. 如何下载youtube的视频?

    导言 当youtube视频需要下载时,发现需要会员等其他限制 别急,下面就是比较稳定的方法 准备 gitub链接 youtube-dl github 官网链接 官网 按照官网提示下载对应版本 我这里是 ...