Cloud and CDN

How to configure HTTPS on Tencent Cloud CDN

By · Last verified

A Tencent Cloud CDN domain such as cdn.example.com serves HTTPS once you attach a certificate on its HTTPS Configuration tab and choose the origin-pull protocol. Forced redirection, HSTS and TLS versions are switches on the same tab. Renewed certificates must reach the CDN through SSL Certificate Service or an upload, because the CDN never renews one itself.

Menu names follow the Tencent Cloud International CDN documentation as of November 2026; parts of those pages are machine-translated, so labels in your console may read slightly differently.

Prerequisites

The CDN domain must already work over HTTP.

  • The domain added to Tencent Cloud CDN, its CNAME pointing at the CDN, and HTTP requests working.
  • If the acceleration region is the Chinese mainland or global, an ICP filing for the domain from China's Ministry of Industry and Information Technology (MIIT). Tencent Cloud states that domains running in the Chinese mainland require one.
  • A certificate covering the domain: one in SSL Certificate Service (see Tencent Cloud SSL certificate), or your own PEM certificate and key, for example from acme.sh.
  • Pages without hard-coded http:// resources.

Step 1: Open HTTPS Configuration

In the CDN console go to Domain Management, click Manage next to the domain, and open the HTTPS Configuration tab. Start the certificate configuration from the HTTPS section. Certificates for several domains can also be managed from Certificate Management → Configure Certificate in the left sidebar.

Step 2: Choose the certificate

The certificate comes either from SSL Certificate Service or from your own PEM files:

  • Tencent Cloud hosted certificate: pick an issued or uploaded certificate from SSL Certificate Service.
  • Your own certificate: paste the full chain in PEM (leaf first, then intermediates) and the PEM private key. A key that belongs to a different certificate is rejected; check with the key matcher first.

Alternatively, start from the certificate side: in SSL Certificate Service open Certificate Details → Quick Deployment, choose CDN and select the domains.

Step 3: Choose the origin-pull protocol

The origin-pull protocol decides whether the CDN-to-origin leg is encrypted. It lives on the Basic Configuration tab under Origin Server Information → Origin-pull protocol, and the certificate deployment flow asks for it too:

  • HTTP: the origin needs no certificate, but the CDN-to-origin leg is unencrypted, and the origin must not redirect HTTP to HTTPS.
  • HTTPS: always fetch over HTTPS.
  • Follow Protocol: use the same protocol as the visitor. Recommended with a valid origin certificate.

For HTTPS or Follow Protocol, the origin must answer HTTPS on port 443 (configuration fails with another port) with a certificate that covers the origin host. COS and FTP origins only support HTTP origin-pull. HTTP/2 is not used towards the origin.

Step 4: Forced redirection, HSTS, TLS and HTTP/2

The remaining HTTPS options are separate sections on the HTTPS Configuration tab:

  • Forced Redirection Configuration: off by default. Switch it on, choose HTTP to HTTPS, and pick 301 as the method (302 is also available).
  • HSTS Configuration: off by default. Enable it only after the whole site works over HTTPS, with a short expireTime at first, and set includeSubDomain only if every subdomain has HTTPS. Read enable HSTS first.
  • TLS Version Configuration: by default TLS 1.0, 1.1 and 1.2 are on and TLS 1.3 is off. Select a consecutive range, typically 1.2 and 1.3. Tencent Cloud documents this setting for Chinese mainland nodes; for a domain accelerated globally, the change applies only in the mainland.
  • HTTP2.0 Configuration: on by default once a certificate is configured; deleting the certificate turns it off.
  • OCSP Stapling Configuration: useful only for certificates whose CA runs OCSP (see the FAQ).

Changes reach the edge nodes within minutes.

Verify

The issuer and expiry should match your certificate, http:// should return 301, and the HSTS header should appear once enabled. Check the domain with the SSL checker, or from any terminal:

curl ssl.sh/cdn.example.com
curl -sI http://cdn.example.com | grep -iE '^(HTTP|location)'
curl -sI https://cdn.example.com | grep -i strict-transport-security

The HSTS checker also shows the header. Confirm the protocol range:

openssl s_client -connect cdn.example.com:443 -servername cdn.example.com -tls1_3 </dev/null 2>/dev/null | grep -E 'Protocol|Cipher'

Automatic renewal

The CDN itself never renews a certificate. Handle renewal by source:

  • Hosted certificate: after it is renewed or replaced in SSL Certificate Service, let Certificate Hosting update the associated CDN domains (check the console for conditions and charges). Free certificates last 3 months and are not auto-renewed, so this still needs a new application each time.
  • Your own certificate: upload the renewed certificate after each renewal. With acme.sh or another ACME client, call the Tencent Cloud API (or the tccli command-line tool) from a renewal hook to upload the certificate and update the CDN domain; check the current API names in Tencent Cloud's API documentation.

Public certificates last at most 200 days since March 15, 2026, 100 days from March 15, 2027 and 47 days from March 15, 2029, so manual replacement will not keep up. Automate it and add the domain to ssl.sh monitoring (in development).

Troubleshooting

FAQ

Hosted certificate or my own certificate?

Prefer a certificate hosted in SSL Certificate Service: when it is renewed or replaced there, Certificate Hosting can update the CDN domain for you. Your own certificate (for example from acme.sh) must be uploaded again after every renewal, which is fine if you automate it with the Tencent Cloud API.

Why does the page redirect endlessly after forcing HTTPS?

The CDN fetches from the origin over HTTP and the origin redirects HTTP to HTTPS, so the request loops. Remove the origin's redirect and redirect only at the CDN, or switch the Origin-pull protocol to HTTPS or Follow Protocol and give the origin a valid certificate on port 443.

Does OCSP stapling help with a Let's Encrypt certificate?

No. Let's Encrypt ended its OCSP service in August 2025 and its certificates contain no OCSP URL. Keep stapling for certificates from CAs that still run OCSP.

Can I enable TLS 1.3?

Yes, in the TLS Version section; it is off by default. Tencent Cloud only allows a consecutive range of versions and requires at least one, so a typical choice is TLS 1.2 and 1.3.

Sources

  1. Tencent Cloud CDN: HTTPS configuration
  2. Tencent Cloud CDN: Origin server configuration
  3. Tencent Cloud CDN: HSTS configuration
  4. Tencent Cloud CDN: TLS version configuration
  5. Tencent Cloud CDN: HTTP 2.0 configuration
  6. Tencent Cloud CDN: ICP filing for domain names in the Chinese mainland
  7. Tencent Cloud SSL Certificates: Deploying a certificate to CDN