Origin SSL validation makes CDN edge servers verify that the origin presents a valid TLS certificate for the expected hostname. proxy_ssl_ca is the public CA certificate that checks the origin certificate, while proxy_ssl_data is an uploaded certificate and private key that the edge presents when the origin requests a client certificate.
ℹ️
An API token is required, along with a CDN resource configured for HTTPS origin pull, a CA certificate to store as proxy_ssl_ca, and an uploaded SSL certificate to send as proxy_ssl_data.
export GCORE_API_KEY="{YOUR_API_KEY}"
Add a trusted CA certificate
Upload the CA certificate that issued the origin certificate. If the origin certificate is self-signed, upload that certificate itself.
A trusted CA request stores that public certificate and returns the id for proxy_ssl_ca.
from gcore import CDB
client = CDB() # Reads GCORE_API_KEY from env
ca = client.cdn.trusted_ca_certificates.create(
name="origin.mywebsite.com",
ssl_certificate=open("ca.pem", encoding="ascii").read(),
)
print(ca.id)
The first resource update requires both certificate ids even when the origin does not request a client certificate. Omitting either id returns HTTP 400 with the message Can not enable proxy_ssl feature while both proxy CA certificate and proxy ssl data not specified.
proxy_ssl_ca and proxy_ssl_data refer to different certificate collections. Sending an SSL certificate id as proxy_ssl_ca, or a trusted CA id as proxy_ssl_data, returns HTTP 400 with the message Invalid pk "1003" - object does not exist.
Disable validation on the resource
The same update turns validation off when proxy_ssl_enabled is false and keeps both certificate ids. A later update can set proxy_ssl_enabled to true alone, because those ids are already stored.
Enable origin SSL validation on a CDN resource with the Terraform provider v2, so edge servers check that the origin presents a valid TLS certificate for the expected hostname. proxy_ssl_ca is the public CA certificate that checks the origin certificate, while proxy_ssl_data is an uploaded client certificate and private key that the edge presents when the origin requests a client certificate. The resource uses HTTPS origin pull.
ℹ️
An uploaded certificate is required for proxy_ssl_data, because the data source reads it when Terraform plans.
📝
proxy_ssl_ca and proxy_ssl_data refer to different certificate collections. Sending a client certificate id as proxy_ssl_ca, or a trusted CA id as proxy_ssl_data, returns HTTP 400 with the message Invalid pk "1003" - object does not exist.
Enable validation
Store the public CA certificate and set proxy_ssl_enabled, proxy_ssl_ca, and proxy_ssl_data on the CDN resource, because creating the resource with proxy_ssl_enabled set to true and only one of those ids returns HTTP 400 with the message Can not enable proxy_ssl feature while both proxy CA certificate and proxy ssl data not specified. If the origin certificate is self-signed, use that certificate as the trusted CA.
Set proxy_ssl_enabled to false and keep both certificate ids. The ids stay on the resource, so a later apply can set proxy_ssl_enabled to true without repeating them.