当前位置: 首页 > java >正文

定期更新Let‘s Encrypt SSL证书遇到的问题

文章目录

  • 概要
  • 报错信息与解决办法
    • 报错信息
    • 解决办法
      • 方法一:手动更新
      • 方法二:自动更新

概要

在文章 用Let‘s Encrypt给网站添加一个免费的SSL证书 中提到了如何手动安装SSL证书,发现到期后通过 crontab 中配置的 certbot renew更新SSL证书并没有生效,在排查问题的过程中发现有坑,于是再总结一下遇到的问题,给有需要的兄弟参考。

以下实操环境:CentOS 7.9 + Nginx,使用的是云服务器。

报错信息与解决办法

报错信息

Let’s Encrypt安装的SSL证书有90天的有效期,接近过期时需要更新证书,可以通过配置定时任务的方式更新证书,由于我们使用的是–manual方式配置的DNS TXT记录,所以到期后通过 certbot renew的方式更新会有问题,报错信息如下:

balabala...
certbot._internal.plugins.disco:Other error:(PluginEntryPoint#manual): An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.
Traceback (most recent call last):File "/usr/lib/python2.7/site-packages/certbot/_internal/plugins/disco.py", line 157, in prepareself._initialized.prepare()File "/usr/lib/python2.7/site-packages/certbot/_internal/plugins/manual.py", line 94, in prepareself.option_name('auth-hook')))
PluginError: An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.
balabala...
PluginSelectionError: The manual plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.',)

此错误大致意思时,如果要更新DNS TXT,由于一开始选择的是 --manual 的方式安装的,那么再次更新需要指定一个 --manual-auth-book参数,此时完整更新命令应该是:

sudo certbot renew \--cert-name your.domain.url.com \--manual \--preferred-challenges dns \--manual-auth-hook /path/to/auth.sh \--manual-cleanup-hook /path/to/clean.sh

关键在于auth.shclean.sh该如何写。

解决办法

方法一:手动更新

此法思路与安装类似,执行

# 注意替换域名
certbot --manual --preferred-challenges dns -d your.domain.url.com

会输出一个新的 DNS TXT记录,

Please deploy a DNS TXT record under the name
_acme-challenge.your.domain.url with the following value:
08QWAexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxNm4
Before continuing, verify the record is deployed.
Press Enter to Continue

登录云服务器后台的 云解析DNS,进到自己的域名内部,更新 _acme-challenge.your.domain.url 中的TXT配置的记录值即可。

方法二:自动更新

自动更新涉及云服务器配置 SECRET_ID 和 SECRET_KEY ,有一定的信安风险,请慎重选择。

新坑代填。。。。。

http://www.xdnf.cn/news/7052.html

相关文章:

  • 代码随想录算法训练营第六十五天| 图论10—卡码网94. 城市间货物运输 I,95. 城市间货物运输 II
  • C++11-(2)
  • 从零启动 Elasticsearch
  • C#接口(Interface)全方位讲解:定义、特性、应用与实践
  • Manus 全面开放注册,OpenAI 发布 Codex,ChatGPT 上线 GPT-4.1!| AI Weekly 5.12-18
  • 【Linux高级全栈开发】2.1.2 事件驱动reactor的原理与实现
  • FTP协议
  • elasticsearch kibana ik 各版本下载
  • 医疗信息系统安全防护体系的深度构建与理论实践融合
  • CSS- 4.4 固定定位(fixed) 咖啡售卖官网实例
  • 多指标组合策略思路
  • PopSQL:一个支持团队协作的SQL开发工具
  • 第9章 组件及事件处理
  • Vue+Go 自定义打字素材的打字网站
  • 18. 结合Selenium和YAML对页面继承对象PO的改造
  • 宝塔面板部署前后端项目SpringBoot+Vue2
  • 蓝桥杯19682 完全背包
  • 【通用大模型】Serper API 详解:搜索引擎数据获取的核心工具
  • iOS 初识RunLoop
  • 用 UniApp 开发 TilePuzzle:一个由 CodeBuddy 主动驱动的拼图小游戏
  • SpringBoot项目里面发起http请求的几种方法
  • EMQX开源版安装指南:Linux/Windows全攻略
  • 连续概率分布 (拉普拉斯分布)
  • Flink 的水印机制
  • 第三十七节:视频处理-视频读取与处理
  • PostGIS实现矢量数据转栅格数据【ST_AsRaster】
  • FFmpeg:多媒体处理的终极利器
  • 有哪些GIF图片转换的开源工具
  • Neo4j数据库
  • spark数据处理练习题详解【上】