Acme.sh:修订间差异

无编辑摘要
 
(未显示同一用户的4个中间版本)
第39行: 第39行:
|-  
|-  
| [[Let's Encrypt]]
| [[Let's Encrypt]]
|
| 使用<code>--server letsencrypt</code>指定CA为Let's Encrypt。示例:<code>acme.sh --issue --dns dns_namesilo -d example.com -d www.example.com --server letsencrypt</code>
| https://letsencrypt.org/
| https://letsencrypt.org/
|-
|-
第55行: 第55行:
}}
}}


== 签发证书 ==
=== 签发方式 ===
{| class="wikitable"  style="width: 100%;
! 验证方式
! 运行方法
! 描述
|-
| rowspan="2" | HTTP
| Webroot 模式
| 当有一个运行的Web服务器,只需要通过<code>-w</code> 指定Web 根文件夹。<br />示例:<code>acme.sh  --issue  -d example.com  -w /home/wwwroot/example.com</code>
|-
| 独立模式
| 如果您没有 Web 服务器,且80 端口没有使用。可以使用独立模式,acme.sh 有一个内置的独立网络服务器,它可以在80端口监听签发证书。<br />示例:<code>acme.sh  --issue  -d example.com  --standalone</code> <br />如果使用了反向代理将http端口转到了其他端口,可以使用<code>--httpport</code>指定端口。<br />示例:<code>acme.sh  --issue  -d example.com  --standalone --httpport 88</code>
|-
| rowspan="2" | DNS
| API模式
| 如果域名服务商提供API,acme.sh可以使用api自动添加域名的txt记录。该模式可以自动签发和续签。<br />命令:<code> acme.sh --issue --dns 域名服务商编码 -d 域名</code><br />示例阿里云域名: <syntaxhighlight lang="bash" >
# 阿里云上获取域名api,并导入到主机中
export Ali_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
export Ali_Secret="jlsdflanljkljlfdsaklkjflsa"
#使用dns API模式签发
acme.sh --issue --dns dns_ali -d example.com -d www.example.com
</syntaxhighlight>
|-
| 手动模式
|
|-
| TLS ALPN
| 独立模式
| 如果您没有 Web 服务器,且443端口没有使用。可以使用TLS ALPN 独立模式,acme.sh 有一个内置的独立网络服务器,它可以在43端口监听签发证书。<br />示例:<code>acme.sh  --issue  -d example.com  --alpn</code> <br />如果使用了反向代理将443端口转到了其他端口,可以使用<code>--tlsport</code>指定端口。<br />示例:<code>acme.sh  --issue  -d example.com  --alpn --tlsport 8443</code>
|-
|}
{{了解更多
|[https://github.com/acmesh-official/acme.sh/wiki/How-to-issue-a-cert acme.sh wiki:如何签发证书]
}}
===  DNS API ===
常用域名服务商如下:
{| class="wikitable"
! 名称
! 描述
|-
| 阿里云
| <syntaxhighlight lang="bash" >
export Ali_Key="<key>"
export Ali_Secret="<secret>"
acme.sh --issue --dns dns_ali -d example.com -d *.example.com
</syntaxhighlight>
|-
| GoDaddy.com
| <syntaxhighlight lang="bash" >
export GD_Key="<key>"
export GD_Secret="<secret>"


acme.sh --issue --dns dns_gd -d example.com -d *.example.com
</syntaxhighlight>
|-
|
|
|}
{{了解更多
|[https://github.com/acmesh-official/acme.sh/wiki/dnsapi  acme.sh wiki:How to use DNS API]
}}
== Docker中使用 ==
== Docker中使用 ==
{{了解更多
|[https://github.com/acmesh-official/acme.sh/wiki/deploy-to-docker-containers  acme.sh wiki:deploy to docker containers]
}}
=== 服务器软件使容器 ===
acme.sh安装在主机上, 将cert/key部署到容器中。
=== 服务器软件和acme.sh都使用容器 ===
====方法1====
以nginx, acme.sh为例:
*使用acme.sh申请一次证书,:
<syntaxhighlight lang="bash" >
sudo docker run --rm  -it  \
    -v "/home/your/project/nginx/ssl":/acme.sh  \
    --name=acme.sh \
    -e Namesilo_Key=xxxxxxxx \
    neilpang/acme.sh acme.sh --issue --dns dns_namesilo -d www.example.com --server letsencrypt  --dnssleep 900
</syntaxhighlight>
====方法2====


==资源==
==资源==

2024年3月26日 (二) 18:03的最新版本

acme.sh 是一个免费开源的,使用shell脚本语言编写的ACME客户端,能够用于自动签发和更新免费证书。

简介

时间轴

  • 2016年4月6日,发布acme.sh 1.2.2。
  • 2018年2月10日,发布acme.sh 2.7.6,支持ACME v2。
  • 2021年8月1日,发布acme.sh 3.0.0,将默认CA改为ZeroSSL,之前是Let's Encrypt

了解更多 >> acme.sh:发布


安装

acme.sh是一个脚本程序,直接下载即可:

#使用curl下载
curl https://get.acme.sh | sh 

#或使用wget下载
wget -O -  https://get.acme.sh | sh



了解更多 >> acme.sh wiki:如何安装


支持的CA

2021年8月1日,将默认CA改为ZeroSSL,之前是Let's Encrypt。

名称 描述 网站
ZeroSSL 默认 https://zerossl.com/
Let's Encrypt 使用--server letsencrypt指定CA为Let's Encrypt。示例:acme.sh --issue --dns dns_namesilo -d example.com -d www.example.com --server letsencrypt https://letsencrypt.org/
SSL.com https://www.ssl.com/
其他CA 任何支持 ACME(RFC 8555)协议的CA https://datatracker.ietf.org/doc/html/rfc8555

了解更多 >> acme.sh:Supported CA acme.sh wiki:默认CA改为ZeroSSL


签发证书

签发方式

验证方式 运行方法 描述
HTTP Webroot 模式 当有一个运行的Web服务器,只需要通过-w 指定Web 根文件夹。
示例:acme.sh --issue -d example.com -w /home/wwwroot/example.com
独立模式 如果您没有 Web 服务器,且80 端口没有使用。可以使用独立模式,acme.sh 有一个内置的独立网络服务器,它可以在80端口监听签发证书。
示例:acme.sh --issue -d example.com --standalone
如果使用了反向代理将http端口转到了其他端口,可以使用--httpport指定端口。
示例:acme.sh --issue -d example.com --standalone --httpport 88
DNS API模式 如果域名服务商提供API,acme.sh可以使用api自动添加域名的txt记录。该模式可以自动签发和续签。
命令: acme.sh --issue --dns 域名服务商编码 -d 域名
示例阿里云域名:
# 阿里云上获取域名api,并导入到主机中
export Ali_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
export Ali_Secret="jlsdflanljkljlfdsaklkjflsa"

#使用dns API模式签发
acme.sh --issue --dns dns_ali -d example.com -d www.example.com
手动模式
TLS ALPN 独立模式 如果您没有 Web 服务器,且443端口没有使用。可以使用TLS ALPN 独立模式,acme.sh 有一个内置的独立网络服务器,它可以在43端口监听签发证书。
示例:acme.sh --issue -d example.com --alpn
如果使用了反向代理将443端口转到了其他端口,可以使用--tlsport指定端口。
示例:acme.sh --issue -d example.com --alpn --tlsport 8443

了解更多 >> acme.sh wiki:如何签发证书


DNS API

常用域名服务商如下:

名称 描述
阿里云
export Ali_Key="<key>"
export Ali_Secret="<secret>"

acme.sh --issue --dns dns_ali -d example.com -d *.example.com
GoDaddy.com
export GD_Key="<key>"
export GD_Secret="<secret>"

acme.sh --issue --dns dns_gd -d example.com -d *.example.com

了解更多 >> acme.sh wiki:How to use DNS API


Docker中使用

了解更多 >> acme.sh wiki:deploy to docker containers


服务器软件使容器

acme.sh安装在主机上, 将cert/key部署到容器中。


服务器软件和acme.sh都使用容器

方法1

以nginx, acme.sh为例:

  • 使用acme.sh申请一次证书,:
sudo docker run --rm  -it  \
    -v "/home/your/project/nginx/ssl":/acme.sh   \
    --name=acme.sh \
    -e Namesilo_Key=xxxxxxxx \
    neilpang/acme.sh acme.sh --issue --dns dns_namesilo -d www.example.com --server letsencrypt  --dnssleep 900


方法2

资源

官网