> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1894.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom SSL certificate configuration

A custom SSL certificate must be issued for the [custom domain](/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn) 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`. Confirm that every required hostname appears in the certificate's Subject Alternative Name (SAN) extension. Wildcard matching follows [RFC 9525](https://www.rfc-editor.org/rfc/rfc9525).

Upload the certificate in the [Gcore Customer Portal](https://portal.gcore.com), then attach it to an existing CDN resource, because custom SSL is not selected on the resource creation form.

## Upload an SSL certificate

<Steps>
  <Step title="Open SSL certificates">
    In the Customer Portal, navigate to **CDN** > **SSL certificates**.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image1.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=63fde6f2600fb45459b66ddafb63815e" alt="SSL certificates list with Add SSL certificate" width="984" height="336" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image1.png" />
    </Frame>
  </Step>

  <Step title="Open the create form">
    Click **Add SSL certificate**. The **Create SSL Certificate** form opens.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image2.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=6c97cbec667d406661e91bed86d77f37" alt="Create SSL Certificate form with Name, Certificate, and Private key" width="984" height="729" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image2.png" />
    </Frame>
  </Step>

  <Step title="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](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format (leaf certificate, intermediate CA, root CA).
    * **Private key**: the matching private key.

    Paste the chain and key as described in [Certificate chain](#certificate-chain-and-key). Leave **Signed by a trusted CA.** checked when the certificate is from a trusted CA. Clear the checkbox when it is not.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image3.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=0e15cdd14125202ff6b1e45b18b25230" alt="Create SSL Certificate form filled with name, certificate chain, and private key" width="639" height="612" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image3.png" />
    </Frame>
  </Step>

  <Step title="Create the certificate">
    Click **Create SSL Certificate**. The certificate appears in the SSL certificates list.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image1.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=63fde6f2600fb45459b66ddafb63815e" alt="SSL certificate in the certificates list" width="984" height="336" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image1.png" />
    </Frame>
  </Step>
</Steps>

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.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image4.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=fbb4072d86f7aa95e62afdd710d64986" alt="Certificate chain pasted into the Certificate field" width="583" height="115" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image4.png" />
</Frame>

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](/cdn/getting-started/create-a-cdn-resource/create-a-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.

<Steps>
  <Step title="Open the CDN resource">
    In the Customer Portal, navigate to **CDN** > **CDN resources** and click the resource **CNAME**.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image6.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=4c1ec5e8dc4fa6fc50baa80feff281a2" alt="CDN resources list with CNAME column" width="1040" height="372" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image6.png" />
    </Frame>
  </Step>

  <Step title="Open SSL settings">
    On the **OPTIONS** tab, open **SSL** under **General**.
  </Step>

  <Step title="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**.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image7.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=96ecfe526ad6cc0fb36c30063abceac0" alt="Enable HTTPS and Custom SSL certificate on an existing resource" width="1120" height="724" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image7.png" />
    </Frame>

    <Accordion title="Certificate not uploaded yet">
      Click **Add SSL certificate**, paste the chain and key in the dialog, then click **Add SSL certificate**. The paste rules match [Certificate chain](#certificate-chain-and-key).

      <Frame>
        <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image8.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=71dc6819b1827da357c5a98f8ca8166b" alt="Add SSL certificate dialog on an existing resource" width="480" height="485" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image8.png" />
      </Frame>
    </Accordion>
  </Step>

  <Step title="Save the SSL settings">
    Click **Save changes**.
  </Step>
</Steps>

## Certificate management

Uploaded certificates are listed under **CDN** > **SSL certificates**. The table shows ID, name, connected CDN resources, start date, and expiration date.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image1.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=63fde6f2600fb45459b66ddafb63815e" alt="SSL certificates table with ID, name, resources, start, and expire" width="984" height="336" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image1.png" />
</Frame>

The certificate name can be changed from **Settings** on the certificate row, while the certificate and private key values cannot be edited after upload.

### SSL certificate renewal

Before expiration, upload a replacement certificate and select it on every resource listed under **CDN resources** for the old certificate.

<Steps>
  <Step title="Upload a replacement certificate">
    Add the replacement in [SSL certificates](#upload-an-ssl-certificate). Do not delete the old certificate yet.
  </Step>

  <Step title="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**.
  </Step>

  <Step title="Wait for HTTPS to use the new certificate">
    Wait at least 15 minutes after the last resource is saved.
  </Step>

  <Step title="Verify each hostname">
    For each hostname on the connected resources, open the site over HTTPS, click the lock icon, open **Connection is secure**, then **Certificate is valid**. Compare the displayed data with the new certificate.
  </Step>

  <Step title="Delete the old certificate">
    After every hostname matches the new certificate, [delete](#delete-an-ssl-certificate) the old certificate. Removing it earlier interrupts HTTPS delivery on any resource that still selects it.
  </Step>
</Steps>

### 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.

<Warning>
  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.
</Warning>

<Steps>
  <Step title="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.
  </Step>

  <Step title="Open the delete action">
    Click the three dots next to the certificate, then click **Delete**. The same menu includes **Settings**.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/3z195f11z8sZ1rxy/images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image5.png?fit=max&auto=format&n=3z195f11z8sZ1rxy&q=85&s=77ea00fadef04a8d6b2097f803d2e8de" alt="Settings and Delete actions on an SSL certificate row" width="1160" height="412" data-path="images/docs/cdn/ssl-certificates/configure-your-own-ssl-certificate/configure-your-own-ssl-certificate-image5.png" />
    </Frame>
  </Step>

  <Step title="Confirm deletion">
    In the confirmation dialog, click **Yes, delete**.
  </Step>
</Steps>
