1、yum install socat -y #安装组件
2、curl https://get.acme.sh | sh -s email=xxxxx@126.com #安装acme
[2024年 09月 27日 星期五 08:42:56 CST] Installing from online archive.
[2024年 09月 27日 星期五 08:42:56 CST] Downloading https://github.com/acmesh-official/acme.sh/archive/master.tar.gz
[2024年 09月 27日 星期五 08:42:58 CST] Extracting master.tar.gz
[2024年 09月 27日 星期五 08:42:58 CST] It is recommended to install socat first.
[2024年 09月 27日 星期五 08:42:58 CST] We use socat for the standalone server, which is used for standalone mode.
[2024年 09月 27日 星期五 08:42:58 CST] If you don't want to use standalone mode, you may ignore this warning.
[2024年 09月 27日 星期五 08:42:58 CST] Installing to /root/.acme.sh
[2024年 09月 27日 星期五 08:42:58 CST] Installed to /root/.acme.sh/acme.sh
[2024年 09月 27日 星期五 08:42:58 CST] Installing alias to '/root/.bashrc'
[2024年 09月 27日 星期五 08:42:58 CST] Close and reopen your terminal to start using acme.sh
[2024年 09月 27日 星期五 08:42:58 CST] Installing alias to '/root/.cshrc'
[2024年 09月 27日 星期五 08:42:58 CST] Installing alias to '/root/.tcshrc'
[2024年 09月 27日 星期五 08:42:58 CST] Installing cron job
[2024年 09月 27日 星期五 08:42:58 CST] bash has been found. Changing the shebang to use bash as preferred.
[2024年 09月 27日 星期五 08:43:00 CST] OK
[2024年 09月 27日 星期五 08:43:00 CST] Install success
3、退出终端,重新进入以华为云为例:需开通授权用户名
export HUAWEICLOUD_Username="xxxxx"
export HUAWEICLOUD_Password="xxxx"
export HUAWEICLOUD_DomainName="xxxx.com"
4、生成证书
acme.sh --issue --dns dns_huaweicloud -d xxxx.com -d *.xxxx.com
acme.sh --renew -d xxxx.com -d *.xxxx.com --force #强制重新生成证书(确保txt记录和HUAWEICLOUD环境变量--先配置,正常后,多试几次)
5、查看证书
acme.sh --info -d xxxx.com
acme.sh --uninstall #卸载
acme.sh --list #查看生成证书
--webroot /var/www/yourdomain #指定目录
--------------------------------------------------------------------------------------------------------------------------------
可以参考证书: