Geo Key Manager v2 使客户在选择密钥存储的地理边界时具有灵活性。
使用 policy 字段,客户可以定义包含允许和阻止国家/地区或区域列表的策略,以指定私钥应存储的位置。
要通过 API 使用 Geo Key Manager v2,通常请按照上传自定义证书的步骤操作。
发送 POST 请求时,请包含 policy 参数以定义包含允许和阻止国家/地区或区域列表的策略,指定私钥应存储的位置。
将私钥存储在欧盟和美国。
Required API token permissions
At least one of the following token permissions is required:Access: Mutual TLS Certificates WriteSSL and Certificates Write
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_certificates" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"certificate": "certificate",
"private_key": "<PRIVATE_KEY>",
"policy": "(country: US) and (region: EU)",
"type": "sni_custom"
}'将私钥存储在欧盟,但不在法国
Required API token permissions
At least one of the following token permissions is required:Access: Mutual TLS Certificates WriteSSL and Certificates Write
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_certificates" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"certificate": "certificate",
"private_key": "<PRIVATE_KEY>",
"policy": "(region: EU) and (not country: FR)",
"type": "sni_custom"
}'Geo Key Manager 的第一个版本支持 3 个区域:美国、欧盟和一组高安全性数据中心。若您希望将私钥限制到其他国家或地区,请申请新版本的内测 ↗。
要在仪表板中使用 Geo Key Manager:
- 按照上传自定义证书的步骤操作。
- 对于 Private Key Restriction(私钥限制),选择以下选项之一:
- Distribute to all Cloudflare data centers (optimal performance)(分发到所有 Cloudflare 数据中心(最佳性能))
- Distribute only to U.S. data centers(仅分发到美国数据中心)
- Distribute only to E.U. data centers(仅分发到欧盟数据中心)
- Distribute only to highest security data centers(仅分发到最高安全数据中心)(更多详情)
- 选择 Upload Custom Certificate(上传自定义证书)。