注册登录
https://freessl.cn/login
控制台-证书列表-申请证书

注意选择【多域名通配符】,也就是第一个品牌。



登录云服务器后台配置,注意记录类型、主机记录、记录值是上面的信息。

配置完成后,从freessl点击【配置完成,立即检测】,注意可能需要等待一些时间。

部署参考:ACME入门
curl实际上是命令行方式下的文件传输工具,在linux上用的比较多,但是也有windows可用的版本。
首先,进入curl官网,下载对应版本:

下载后解压。
然后配置环境变量:CURL_HOME,该变量内容为C:\Tool\curl-7.83.1_5-win64-mingw\bin
最后给PATH加上;%CURL_HOME%;
安装后进入cmd,执行curl --help测试安装是否成功。
git 对命令支持较好,切换到想安装acme的目录,执行:curl https://gitcode.net/cert/cn-acme.sh/-/raw/master/install.sh?inline=false | sh -s email=my@example.com,完成安装后重新打开git命令行。
运行部署命令:

注意目录需要根据服务器真实情况修改。
部署到apache:
acme.sh --install-cert -d example.com \
--cert-file /path/to/certfile/in/apache/cert.pem \
--key-file /path/to/keyfile/in/apache/key.pem \
--fullchain-file /path/to/fullchain/certfile/apache/fullchain.pem \
--reloadcmd "service apache2 force-reload"
部署到nginx
acme.sh --install-cert -d example.com \
--key-file /path/to/keyfile/in/nginx/key.pem \
--fullchain-file /path/to/fullchain/nginx/cert.pem \
--reloadcmd "service nginx force-reload"
证书有效期30天,acme.sh自动续期
acme.sh模式好处是自动续期,缺点是只能生成pem证书,tomcat用的证书需要转化的,不行。