更新 ACME EAB IP 白名单
更新 TrustAsia CertAsia 弹性证书 ACME EAB 凭据的 IP 白名单。
白名单用于限制只有来自指定 IP 或 CIDR 范围的请求才能使用此 EAB 凭据。 全量替换:每次调用会覆盖之前的白名单设置。
- 传入 非空数组 → 只允许列表中的 IP / CIDR 使用此 EAB
- 传入空数组
[]→ 清除限制,任意 IP 均可使用
前置条件
- 证书已创建 EAB 凭据(
eab_kid不为空),如未创建请先调用创建 EAB 凭据
接口地址
PUT /api/v1/certificate/acme/eab-white-ips
Host:
...
完整地址
/api/v1/certificate/acme/eab-white-ips
请求
Content-Type: application/json
Content-Length: 78
{
"service_id": "J94V73", // 证书编号,必填
"white_ips": [ // IP 白名单列表,全量替换
"192.168.1.100", // 单个 IPv4
"10.0.0.0/8", // IPv4 CIDR 范围
"2001:db8::1", // 单个 IPv6
"2001:db8::/32" // IPv6 CIDR 范围
]
}
清空白名单
传入空数组即可清除 IP 限制:
{
"service_id": "J94V73",
"white_ips": []
}
清空后任意 IP 均可使用此 EAB 凭据。
响应
- response
- 清空白名单
- errors
HTTP/1.1 200 OK
Content-Type: application/json
{
"success": true,
"data": {
"order_id": "TA-xxxxx", // CA 侧订单号
"eab_kid": "eab-key-xxxxx", // EAB Key Identifier
"white_ips": [ // 更新后的 IP 白名单
"192.168.1.100",
"10.0.0.0/8",
"2001:db8::1",
"2001:db8::/32"
]
}
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"success": true,
"data": {
"order_id": "TA-xxxxx",
"eab_kid": "eab-key-xxxxx",
"white_ips": [] // 空数组,表示无 IP 限制
}
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"success": false,
"message": "当前证书尚未创建 ACME EAB,无法更新 IP 白名单"
}
错误码
| HTTP 状态码 | message | 含义与处理建议 |
|---|---|---|
| 400 | 该证书不支持 ACME EAB | 证书供应商不是 TrustAsia,无法更新 IP 白名单 |
| 400 | 当前证书尚未创建 ACME EAB,无法更新 IP 白名单 | 尚未创建 EAB 凭据,请先调用创建 EAB 凭据 |
| 404 | The certificate is not found | 证书不存在,或不属于当前 API 密钥对应的工作空间 |
| 422 | The service ID is required | 未提供证书编号 service_id |
| 422 | The white_ips field is required | 未提供 white_ips 字段(空数组需显式传入 []) |
| 422 | The white_ips may not have more than 50 items | 白名单条目超过 50 条上限 |