A certificate is ready to upload when it covers the custom domain of the CDN resource (cdn.example.com).
A certificate for *.example.com covers one DNS label under that domain (cdn.example.com). It does not cover the apex domain example.com or a nested hostname assets.cdn.example.com. Every required hostname belongs in the certificate's Subject Alternative Name (SAN) extension. Wildcard matching follows RFC 9525.
Upload the certificate in the CDB Technical Web Portal, then attach it to an existing CDN resource, because custom SSL is not selected on the resource creation form.
Upload an SSL certificate
1
Open SSL certificates
In the Customer Portal, navigate to CDN > SSL certificates.
2
Open the create form
Click Add SSL certificate. The Create SSL Certificate form opens.
3
Enter the certificate data
Enter the values from the certificate authority:
Name: a label used only in the Customer Portal.
Certificate: the certificate chain in PEM format (leaf certificate, intermediate CA, root CA).
Private key: the matching private key.
Paste the chain and key as described in Certificate chain. Leave Signed by a trusted CA. checked when the certificate is from a trusted CA. Clear the checkbox when it is not.
4
Create the certificate
Click Create SSL Certificate. The certificate appears in the SSL certificates list.
Attach the certificate to a CDN resource after upload, because an uploaded certificate is not used until it is selected on a resource.
Certificate chain and key
Open the certificate file in PEM format (.pem, .crt, or .cer) in a text editor.
Copy the chain in this order: leaf certificate, intermediate CA, root CA. Paste the full contents into Certificate, including the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- tags. Do not leave blank lines between certificates.
Add a new line at the end of the chain.
Open the private key file (.key) in a text editor. Paste the full contents into Private key, and keep the exact BEGIN and END lines from the key file. Common delimiters include -----BEGIN PRIVATE KEY----- and -----BEGIN RSA PRIVATE KEY-----.
SSL certificate on a CDN resource
Create the CDN resource first. On the create form, enter the hostname in Add domain. After the resource exists, attach the custom certificate in the resource SSL settings.
1
Open the CDN resource
In the Customer Portal, navigate to CDN > CDN resources and click the resource CNAME.
2
Open SSL settings
On the OPTIONS tab, open SSL under General.
3
Select the custom certificate
Turn on Enable HTTPS and select Custom SSL certificate. If a certificate is already uploaded, select it in the certificate dropdown. If none are uploaded, click Add SSL certificate.
4
Save the SSL settings
Click Save changes.
Certificate management
Uploaded certificates are available under CDN > SSL certificates. In the Customer Portal, only the certificate name can be changed after upload — use Settings on the certificate row. To change the certificate or private key, upload a replacement and attach it on every resource listed under CDN resources.
SSL certificate renewal
Before expiration, upload a replacement certificate and select it on every resource listed under CDN resources for the old certificate.
1
Upload a replacement certificate
Add the replacement in SSL certificates. Do not delete the old certificate yet.
2
Replace it on every connected resource
On the old certificate row, note every resource under CDN resources. For each listed resource, open SSL settings, select the new certificate, and click Save changes.
3
Wait for HTTPS to use the new certificate
Wait at least 15 minutes after the last resource is saved.
4
Verify each hostname
For each hostname, open the site over HTTPS and inspect the certificate presented by the browser. The subject, SAN, and validity dates should match the replacement certificate.
5
Delete the old certificate
After every hostname matches the new certificate, delete the old certificate. Removing it earlier interrupts HTTPS delivery on any resource that still selects it.
Expiration notifications
Notification emails are sent to the administrator and engineer addresses 14 days before expiration, seven days before expiration, and on the expiration date. A reminder also appears on login during those 14 days and after expiration. SSL certificates in the side panel shows an exclamation mark when a certificate is expired or will expire within 14 days.
A red exclamation mark marks an expired certificate, while a yellow warning marks a certificate that expires in 14 days or fewer.
Delete an SSL certificate
A certificate that is selected on a CDN resource cannot be deleted. Replace it on every connected resource first.
⚠️
Turning off Enable HTTPS stops HTTPS delivery on that resource. To detach a certificate, select a replacement certificate on every connected resource. Turn off Enable HTTPS only when HTTPS delivery is being removed.
1
Detach the certificate from every resource
On the certificate row, note every resource under CDN resources. For each listed resource, open SSL settings and select a replacement certificate, then click Save changes. Turn off Enable HTTPS only when HTTPS delivery is being removed from that resource.
2
Open the delete action
Click the three dots next to the certificate, then click Delete. The same menu includes Settings.
3
Confirm deletion
In the confirmation dialog, click Yes, delete.
Upload a custom SSL certificate in PEM format, attach it to an existing CDN resource, and replace or delete it when the certificate changes. The certificate must cover the resource custom domain in its Subject Alternative Name (SAN) extension.
ℹ️
An API token is required. The CDN resource ID is visible under CDN → CDN Resources, or from the resources list call.
Open a terminal and export the required variables. SSL_CERTIFICATE and SSL_PRIVATE_KEY are the PEM chain and key with a newline after every line, including the final END line:
Create the certificate object first. HTTPS does not use it until the ID is set on a CDN resource. validate_root_ca is true when a trusted CA signed the chain. Set it to false for a private or self-signed chain — otherwise the API returns HTTP 400.
Parameter
Required
Description
name
Yes
Unique label for the certificate object
sslCertificate
Yes
PEM chain: leaf, intermediates, root, separated by \n
sslPrivateKey
Yes
Matching private key in PEM
validate_root_ca
No
Set to true for a trusted CA chain, false for a private or self-signed chain
import os
from gcore import CDB
client = CDB()
client.cdn.certificates.create(
name="cdn.example.com",
ssl_certificate=os.environ["SSL_CERTIFICATE"],
ssl_private_key=os.environ["SSL_PRIVATE_KEY"],
validate_root_ca=True,
)
uploaded = next(
item
for item in client.cdn.certificates.list(automated=False)
if item.name == "cdn.example.com"
)
print(uploaded.id, uploaded.cert_subject_cn, uploaded.validity_not_after)
The upload endpoint creates the certificate object. Use the returned id to attach it to a CDN resource. If the SDK create method does not return the object, retrieve the certificate by name from the certificate list.
Get the certificate ID
The curl upload response already includes id. Use the list call when the SDK create method returns nothing, or when the ID is no longer at hand.
from gcore import CDB
client = CDB()
uploaded = next(
item
for item in client.cdn.certificates.list(automated=False)
if item.name == "cdn.example.com"
)
print(uploaded.id, uploaded.name)
The API returns the same certificate object as the upload response, including id.
Attach a certificate to a CDN resource
Set sslEnabled to true and sslData to the certificate ID on the resource. An uploaded certificate is unused until this call succeeds. Wait at least 15 minutes after the last attach before checking HTTPS in a browser.
import os
from gcore import CDB
client = CDB()
resource = client.cdn.cdn_resources.update(
resource_id=int(os.environ["CDN_RESOURCE_ID"]),
ssl_enabled=True,
ssl_data=312679,
)
print(resource.id, resource.ssl_enabled, resource.ssl_data)
The certificate name is a unique label. A curl PUT can send name alone. The REST API can also replace the uploaded chain and key on the existing certificate object — the Customer Portal cannot edit that material after create. The Python and Go replace methods send name together with the PEM files: pass the same files to change only the label, or a new chain to replace the uploaded material.
import os
from gcore import CDB
client = CDB()
detail = client.cdn.certificates.replace(
ssl_id=312679,
name="cdn.example.com-2026",
ssl_certificate=os.environ["SSL_CERTIFICATE"],
ssl_private_key=os.environ["SSL_PRIVATE_KEY"],
validate_root_ca=True,
)
print(detail.id, detail.name)
The API returns the CDN resource with sslData set to the replacement ID. Repeat the PATCH for every resource in the usage list.
Wait at least 15 minutes after the last resource update. For each hostname, open the site over HTTPS and inspect the certificate presented by the browser. The subject, SAN, and validity dates should match the replacement certificate. Keep the old certificate until that check succeeds.
Delete a certificate
A certificate that is still selected on a resource cannot be deleted. After HTTPS presents the replacement certificate, delete the old object.
from gcore import CDB
client = CDB()
client.cdn.certificates.delete(312679)
Delete returns HTTP 204. If the certificate is still selected on a resource, the API returns HTTP 400:
{
"errors": [
"You cannot delete this certificate because it is used by resources: [101]. Unlink the certificate and try again."
]
}
Stop HTTPS delivery
When HTTPS delivery is being removed from a resource, set sslEnabled to false and sslData to null before deleting the unused certificate. That stops HTTPS on the resource.
⚠️
Setting sslEnabled to false stops HTTPS delivery on that resource.
import os
from gcore import CDB
client = CDB()
client.cdn.cdn_resources.update(
resource_id=int(os.environ["CDN_RESOURCE_ID"]),
ssl_enabled=False,
ssl_data=None,
)
Upload a custom SSL certificate and attach it to a CDN resource with the Terraform provider v2.
The certificate must cover the resource custom domain in its Subject Alternative Name (SAN) extension. The PEM file contains the leaf certificate, then intermediate certificates, then the root, with a newline after the final END line. Set automated to false. A later edit that omits it replaces the certificate. Set validate_root_ca to false for a private or self-signed chain. The same chain with true returns HTTP 400, because a trusted CA cannot confirm it. Wait at least 15 minutes after the last attach before checking HTTPS in a browser.
Upload the certificate
Create the certificate and set ssl_enabled and ssl_data on the CDN resource. One terraform apply uploads the certificate and attaches it. ssl_certificate_wo and ssl_private_key_wo are write-only: Terraform sends the PEM files and does not store them in state.
Replace fullchain.pem and privkey.pem, increment ssl_certificate_wo_version, and run terraform apply. The same certificate object is updated. The apply prints an error that cert_subject_cn, cert_issuer, and validity_not_after changed. The next terraform plan shows no differences.
Add the replacement certificate with ssl_data pointing at it, and run terraform apply twice. The first apply creates the certificate and leaves the resource on the previous certificate. The second apply attaches the new certificate. Wait at least 15 minutes, then check HTTPS for each hostname.
Set ssl_data to the certificate that remains and run terraform apply while the old certificate block is still present. Then remove the old block and run terraform apply again. Removing the block in the same apply as the ssl_data change returns HTTP 400, because the resource still selects that certificate.
Set ssl_enabled to false and ssl_data to null, then run terraform apply, to stop HTTPS while the certificate object remains. terraform destroy deletes the CDN resource first, then the certificate and the origin group.