Deploy custom certificate
Enterprise customers who do not wish to install the Cloudflare certificate have the option to upload their own root certificate to Cloudflare. This feature is sometimes referred to as Bring Your Own Public Key Infrastructure (BYOPKI). Gateway will use your uploaded certificate to encrypt all sessions between the end user and Gateway, enabling all HTTPS inspection features that previously required the Cloudflare certificate. You can upload multiple certificates to your account, but only one can be active at any given time. You also need to upload a private key to intercept domains with JIT certificates and to enable the block page.
Before you generate a custom root CA, make sure you have OpenSSL ↗ installed.
-
Open a terminal.
-
Create a directory for the root CA and change into it.
-
Generate a private key for the root CA.
-
Generate a self-signed root certificate.
When preparing your certificate and private key for upload, be sure to remove any unwanted characters, such as mismatching subdomains in the certificate’s common name. To review the private key, run the following command:
To review the certificate, run the following command:
-
Verify that the certificate is installed on your devices.
-
Use the Upload mTLS certificate endpoint to upload the certificate and private key to Cloudflare. The certificate must be a root CA, formatted as a single string with
\n
replacing the line breaks.The response will return a UUID for the certificate:
-
Enable the certificate in Gateway with its UUID.
The response will show the current status of the certificate:
Once binding_status
changes to active
, Gateway will sign your traffic using the custom root certificate and private key. If you disable the custom certificate, Gateway will revert to the default Cloudflare certificate.
If Gateway returns an HTTP Response Code: 526 after deploying a custom certificate, you can troubleshoot errors with our FAQ.