跳到主要内容
版本:latest

apply_cert_api

创建 Let's Encrypt(或其他 ACME CA)证书申请订单。支持三种验证方式。

  • 路由POST /acme
  • actionapply_cert_api

输入参数

参数名称必选类型描述
actionString固定值 apply_cert_api
idInteger关联网站 ID
domainsStringJSON 数组,要申请的域名列表 ["example.com","www.example.com"]
auth_typeString验证方式:http(文件)、tls(TLS)、dns(DNS)
auth_toString验证路径。HTTP/TLS 传网站目录;DNS 验证传 dns
auto_wildcardString"1" 自动申请泛域名 *.example.com
caStringCA 标识,默认 Let's Encrypt
DNS 验证

auth_type=dns, auth_to=dns 时仅创建订单。需再用 apply_dns_auth 完成 DNS TXT 记录创建和验证。

输出参数

参数名称类型描述
statusStringpending 订单待验证
indexString订单索引 ID,后续操作需要
domainsArray申请的域名列表
authorizationsArrayLet's Encrypt 授权 URL 列表
expiresInteger订单过期时间戳
create_timeInteger创建时间戳

示例

请求(DNS 验证)

POST /acme HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded

action=apply_cert_api&id=1&domains=["dnstest.cc"]&auth_type=dns&auth_to=dns

响应

{
"status": "pending",
"index": "a7a0472c4a5061ec83450119b874a5d3",
"domains": ["dnstest.cc"],
"auth_type": "dns",
"expires": 1780111135,
"create_time": 1779506335,
"authorizations": ["https://acme-v02.api.letsencrypt.org/acme/authz/..."]
}

相关接口