The X

acme.sh 命令行工具

acme.sh实现了 acme 协议, 可以生成免费Let's Encrypt 的https证书。可以和部分云服务商无缝对接,实现全自动证书生成与续期。以下展示了acme.sh主要参数及介绍说明。通过勾选的方式直接生成对应的命令行参数。帮助你快速学习使用acme.sh的功能。

command

-h --help
显示此帮助消息
-v --version
显示版本信息
--install
安装acme.sh
--uninstall
卸载acme.sh,然后卸载cron作业。
--upgrade
从升级acme.sh至最新代码https://github.com/acmesh-official/acme.sh。
--issue
颁发证书
--deploy
Deploy the cert to your server.
-i --install-cert
将颁发的证书安装到apache/nginx或任何其他服务器上。
-r --renew
更新证书
--renew-all
Renew all the certs.
--revoke
Revoke a cert.
--remove
从acme.sh已知的证书列表中删除证书。
--list
List all the certs.
--to-pkcs12
将证书和密钥导出到pfx文件。
--to-pkcs8
Convert to pkcs8 format.
--sign-csr
从现有csr颁发证书。
--show-csr
Show the content of a csr.
-ccr --create-csr
Create CSR, professional use.
--create-domain-key
创建域私钥,专业使用。
--update-account
Update account info.
--register-account
Register account key.
--deactivate-account
Deactivate the account.
--create-account-key
创建帐户私钥,专业使用。
--install-cronjob
安装cron作业来更新证书,您不需要调用它。install命令可以自动安装cron作业。
--uninstall-cronjob
卸载cron作业。“uninstall”命令可以自动执行此操作。
--cron
运行cron job以续订所有证书。
--set-notify
设置cron通知钩子、级别或模式。
--deactivate
停用域名认证,专业使用。
--set-default-ca
与'--server'一起使用,设置要使用的默认CA。 请参见:https://github.com/acmesh-official/acme.sh/wiki/Server

Parameters

-d --domain
指定域,用于发布、续订或吊销等。
--challenge-alias
DNS别名模式的质询域别名。 请参见:https://github.com/acmesh-official/acme.sh/wiki/DNS-alias-mode
--domain-alias
DNS别名模式 请参见:https://github.com/acmesh-official/acme.sh/wiki/DNS-alias-mode
--preferred-chain
如果CA提供多个证书链,则首选具有与此使用者公用名匹配的颁发者的链。 如果不匹配,将使用默认提供的链。(默认值:空) 请参见:https://github.com/acmesh-official/acme.sh/wiki/Preferred-Chain
-f --force
强制安装、强制证书续订或覆盖sudo限制。
--staging --test
使用暂存服务器进行测试。
--debug
输出调试信息。如果省略参数,则默认为1。
--output-insecure
输出所有敏感信息。 默认情况下,为了安全起见,所有凭据/敏感消息都从输出/调试/日志中隐藏。
-w --webroot
指定web根模式的web根文件夹。
--standalone
Use standalone mode.
--alpn
Use standalone alpn mode.
--stateless
使用无状态模式。 请参见:https://github.com/acmesh-official/acme.sh/wiki/Stateless-Mode
--apache
Use apache mode.
--dns
使用dns手动模式或dns api。省略参数时默认为手动模式。 请参见:https://github.com/acmesh-official/acme.sh/wiki/dnsapi
--dnssleep
在dns api模式下等待所有txt记录传播的时间(以秒为单位)。 默认情况下不必使用此选项,acme.sh会自动按DOH轮询dns状态。
-k --keylength
指定域密钥长度:2048、3072、4096、8192或ec-256、ec-384、ec-521。
-ak --accountkeylength
指定帐户密钥长度:2048、3072、4096
--log
指定日志文件。如果省略参数,则默认为“/app/acme/acme.sh.log”。
--log-level
指定日志级别,默认值为1。
--syslog
系统日志级别,0:禁用系统日志,3:错误,6:信息,7:调试。
--eab-kid
外部帐户绑定的密钥标识符。
--eab-hmac-key
用于外部帐户绑定的HMAC密钥。

These parameters are to install the cert to nginx/apache or any other server after issue/renew a cert

--cert-file
颁发/续订后将证书文件复制到的路径。。
--key-file
密钥文件在发出/续订后复制到的路径。
--ca-file
发布/续订后将中间证书文件复制到的路径。
--fullchain-file
发出/续订后将fullchain证书文件复制到的路径。
--reloadcmd
发出/续订后要执行的命令以重新加载服务器。
--server
ACME目录资源URI。(默认值:https://acme-v02.api.letsencrypt.org/目录) 请参见:https://github.com/acmesh-official/acme.sh/wiki/Server
--accountconf
指定自定义帐户配置文件。
--home
指定acme.sh的主目录。
--cert-home
指定保存所有证书的主目录,仅对“-install”命令有效。
--config-home
指定保存所有配置的主目录。
--useragent
指定用户代理字符串。它也会保存起来以备将来使用。
-m --email
指定帐户电子邮件,仅对“-install”和“-update account”命令有效。
--accountkey
指定帐户密钥路径,仅对“-install”命令有效。
--days
指定使用“-issue”命令时续订证书的天数。默认值为60天。
--httpport
指定独立侦听端口。仅当服务器位于反向代理或负载平衡器后面时有效。
--tlsport
指定独立tls侦听端口。仅当服务器位于反向代理或负载平衡器后面时有效。
--local-address
如果您有多个ip地址,则指定独立/tls服务器侦听地址。
--listraw
仅用于“-list”命令,以原始格式列出证书。
-se --stop-renew-on-error
仅对“--renew all”命令有效。如果一个证书在续订时出错,则停止。
--insecure
不要检查服务器证书,在某些设备中,api服务器的证书可能不可信。
--ca-bundle
指定CA证书束的路径,以验证api服务器的证书。
--ca-path
指定包含wget或curl使用的PEM格式CA证书的目录。
--no-cron
仅对'--install'命令有效,这意味着:不要安装默认cron作业。 在这种情况下,证书不会自动续订。
--no-profile
仅对'--install'命令有效,这意味着:不要在用户配置文件中安装别名。
--no-color
Do not output color text.
--force-color
强制输出彩色文本。对于非交互式使用aha工具处理HTML电子邮件非常有用。
--ecc
指定使用ECC证书。对“--install cert”、“--renew”、“--revoke”、“--to-pkcs12”和“--create csr”有效
--csr
Specifies the input csr.
--pre-hook
在获取任何证书之前要运行的命令。
--post-hook
尝试获取/续订证书后要运行的命令。无论获取/续订成功还是失败都将运行。
--renew-hook
在每个成功续订的证书之后运行的命令。
--deploy-hook
The hook file to deploy cert
--ocsp --ocsp-must-staple
生成OCSP必须绑定扩展。
--always-force-new-domain-key
续订时生成新的域密钥。否则,默认情况下不会更改域密钥。
--auto-upgrade
对“-upgrade”命令有效,指示将来是否自动升级。如果省略参数,则默认为1。
--listen-v4
强制独立/tls服务器侦听ipv4。
--listen-v6
强制独立/tls服务器侦听ipv6。
--openssl-bin
指定自定义openssl bin位置。
--use-wget
如果同时安装了curl和wget,则强制使用wget。
--yes-I-know-dns-manual-mode-enough-go-ahead-please
强制使用dns手动模式。 请参见:https://github.com/acmesh-official/acme.sh/wiki/dns-manual-mode
-b --branch
仅对“-upgrade”命令有效,指定要升级到的分支名称。
--notify-level
设置通知级别:默认值为2。 0:已禁用,将不发送通知。 1: 仅在出现错误时发送通知。 2: 在证书成功续订或出现错误时发送通知。 3: 当证书被跳过、续订或出错时发送通知。
--notify-mode
设置通知模式。默认值为0。 0:批量模式。在一封邮件中发送所有域的通知。 1: 证书模式。为每个证书发送消息。
--notify-hook
Set the notify hook
--revoke-reason
吊销的原因可以与“-revoke”命令一起使用。 请参见:https://github.com/acmesh-official/acme.sh/wiki/revokecert
--password
设置导出的pfx文件密码。与--to-pkcs12一起使用。

acme.sh 常见用法

  • 正在开发

其他工具

  • 正在开发