在腾讯云 CDN 上自动部署 Let's Encrypt 证书
几个小时前,我去年在腾讯云 CDN 上部署的 avatar.dawnlab.me
的证书过期了,考虑到部署证书这种事不适合我这种懒癌患者,于是用腾讯云的 API 写了个自动部署,配合 acme.sh 食用更佳
Github:https://github.com/idawnlight/qcloud-lets-encrypt
用法
composer install
/composer create-project idawnlight/qcloud-lets-encrypt
- 将
config.example.php
复制为config.php
,根据提示完成相关配置 - 以 acme.sh 为例,在
~/.acme.sh/[main domain]/[main domain].conf
中配置Le_RenewHook
字段,以下为示例
~/.acme.sh/acme.sh\
--install-cert\
-d [main domain]\
--fullchain-file /tmp/cert.cer\
--key-file /tmp/cert.key\
&& php /some/path/index.php\
--cert /tmp/cert.cer\
--key /tmp/cert.key\
&& rm -f /tmp/cert.cer /tmp/cert.key
坑
- 腾讯云的 CAM 权限管理并不支持 SSL 证书管理,所以必须用主账号的 API Key
- 腾讯云 API v3 根本没有 CDN 的证书部署和 SSL 证书管理,因此只能用 API v2
本文链接:https://blog.lim-light.com/archives/use-lets-encrypt-cert-on-tencent-cloud.html
本文采用 CC BY-NC-SA 3.0 CN 协议进行许可,阅读 相关说明