更新 ACME EAB IP 白名單
更新 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 | 證書供應商無法更新 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 條上限 |