跳转到主要内容

Setup

import { Render, TabItem, Tabs, InlineBadge, APIRequest, Example, } from "~/components";

Geo Key Manager v2

:::note

Geo Key Manager v2 is only available through the Cloudflare API.

:::

Geo Key Manager v2 gives customers flexibility when choosing the geographical boundaries of where their keys are stored.

Using the policy field, customers can define policies containing allow and block lists of countries or regions where the private key should be stored.

To use Geo Key Manager v2 with the API, generally, follow the steps to upload a custom certificate.

When sending the POST request, include the policy parameter to define policies containing allow and block lists of countries or regions where the private key should be stored.

:::note

You also have access to the geo_restrictions parameter, which is mutually exclusive with the policy parameter and is part of Geo Key Manager v1.

:::

Examples

Store private keys in the E.U. and the U.S.

<APIRequest path="/zones/{zone_id}/custom_certificates" method="POST" json={{ certificate: "certificate", private_key: "<PRIVATE_KEY>", policy: "(country: US) and (region: EU)", type: "sni_custom", }} />

Store private keys in the E.U., but not in France

<APIRequest path="/zones/{zone_id}/custom_certificates" method="POST" json={{ certificate: "certificate", private_key: "<PRIVATE_KEY>", policy: "(region: EU) and (not country: FR)", type: "sni_custom", }} />

:::note

For more information on the policy field, refer to Supported options.

:::

Geo Key Manager v1

To use Geo Key Manager in the dashboard:

  1. Follow the steps to upload a custom certificate.
  2. For Private Key Restriction, choose one of the following options:
    • Distribute to all Cloudflare data centers (optimal performance)
    • Distribute only to U.S. data centers
    • Distribute only to E.U. data centers
    • Distribute only to highest security data centers (more details)
  3. Select Upload Custom Certificate.

To use Geo Key Manager with the API, generally, follow the steps to upload a custom certificate.

When sending the POST request, include the geo_restrictions parameter set to one of the following options: