SSL/TLS
Deploy free or custom certificates per hostname, set the encryption mode, Force HTTPS, HSTS and security headers, and issue Origin CA certificates.
SSL/TLS settings are on the SSL/TLS tab of a site's detail page (/cdn/domains/<domain>/ssl). HTTPS on the CDN involves two connections:
- Visitor ↔ edge: uses the edge certificate deployed for each hostname. This is either a free automatic certificate or one you upload.
- Edge ↔ origin: the encryption mode and the hostname's origin protocol decide whether this connection is encrypted and whether the origin certificate is validated.
Deploying edge certificates
The 边缘证书管理 (Edge certificates) table lists every hostname on the site with its SSL status, issuer and expiry date. Click 管理证书 (Manage certificate) to open the certificate dialog. There are three ways to add a certificate.
Option 1: Free automatic certificate (Let's Encrypt)
- Make sure the hostname's DNS already points to the CDN, through CNAME or nameserver setup. Validation uses HTTP-01, so the edge must be able to answer Let's Encrypt's validation request.
- On the 自动证书 (Let's Encrypt) tab, click HTTP-01 验证 (HTTP-01 validation).
- The dialog shows progress through three stages: 等待处理 (queued), 域名验证中 (validating), 证书签发中 (issuing). When it finishes, the status becomes 已签发 (Issued). If it fails, 证书申请失败 (Request failed) appears with the reason.
Automatic certificates are valid for 90 days. They are renewed and redeployed to the edge automatically before they expire, so you have nothing to do. Once a certificate exists, the button reads 续费证书 (Renew certificate), which you can use to renew early.
Wildcard hostnames such as *.example.com cannot be validated with HTTP-01. Deploy a wildcard certificate through Custom certificate or Certificate library instead (see below).
Force HTTPS does not interfere with HTTP-01 validation. The edge answers validation requests first.
Option 2: Upload a custom certificate
- Switch to the 自定义证书 (Custom certificate) tab.
- Paste the certificate into 证书 (PEM格式) (Certificate, PEM). Include the full chain: your server certificate first, then the intermediates.
- Paste the matching private key into 私钥 (PEM格式) (Private key, PEM).
- Click 上传证书 (Upload certificate). The status changes to 自定义证书 (Custom certificate).
Custom certificates are not renewed automatically. Upload a new one before the current one expires.
Option 3: Deploy from the certificate library
If you bought or stored certificates in the Yeap Cloud SSL certificate service, you can pick one on the 证书夹 (Certificate library) tab. It lists the certificates that match the hostname, including wildcard certificates that cover it. Select one to deploy it.
Encryption mode (edge to origin)
In the SSL/TLS 加密模式 (Encryption mode) card, choose a mode and click 保存 (Save):
| Mode | Edge to origin | Use when |
|---|---|---|
| 关闭 (Off) | Plain HTTP | Your origin only serves HTTP |
| 灵活 (Flexible) | Plain HTTP | Your origin has no certificate, but you want visitors on HTTPS |
| 完全 (Full) | HTTPS, origin certificate not validated | Your origin uses a self-signed or Origin CA certificate |
| 完全(严格) (Full strict) | HTTPS, origin certificate validated | Your origin has a valid certificate for your domain from a publicly trusted CA |
How the mode interacts with other settings:
- The table applies to hostnames whose origin protocol is 自动 (Auto). If you set the origin protocol to HTTP or HTTPS explicitly on the Origin tab, the protocol wins. Full (strict) validates the certificate only when the edge connects to the origin over HTTPS.
- Whether visitors can reach the edge over HTTPS depends only on whether the hostname has an edge certificate. The encryption mode does not change it.
- Switching to Off or Flexible asks for confirmation, because traffic between the edge and your origin will no longer be encrypted.
- In Full (strict), requests to the origin fail if the origin certificate is invalid, expired or does not match the domain.
- HTTP/2 to the origin needs an HTTPS origin connection, so in Off and Flexible modes the edge falls back to HTTP/1.1.
In Flexible mode, if your origin also redirects HTTP to HTTPS, visitors get an infinite redirect loop. Switch to Full, or turn off the origin's own redirect. The Diagnostics (诊断) tab can detect this.
Force HTTPS
Turn on 强制 HTTPS (Force HTTPS) in the HTTPS 设置 (HTTPS settings) card to redirect every HTTP request to the same URL over HTTPS with a 301. This controls how visitors connect. It does not change the origin protocol.
Before you turn it on, make sure every hostname on the site has a valid edge certificate. Otherwise visitors will see certificate errors.
HSTS and security headers
The settings in the HSTS 与安全响应头 (HSTS and security headers) card are added by the edge to responses sent to visitors. After you change them, click 保存 (Save) in the card's top-right corner.
HSTS (HTTP Strict Transport Security)
| Field | Description |
|---|---|
| Toggle | Adds a Strict-Transport-Security header to HTTPS responses. It is never added to plain-HTTP responses |
| max-age (秒) (max-age, seconds) | How long browsers must use HTTPS. 31536000 (one year) is common |
| 包含子域 (Include subdomains) | Adds includeSubDomains |
| Preload | Adds preload, which you need to apply for browser HSTS preload lists |
Once a browser has seen HSTS, it refuses plain HTTP for that domain for the whole max-age. Check that HTTPS works everywhere first. Then start with a small max-age such as 300 seconds and raise it gradually.
Other security headers
- X-Frame-Options:
SAMEORIGINorDENY, to prevent clickjacking. - Referrer-Policy: pick a policy from the list.
- X-Content-Type-Options: nosniff: stops browsers from MIME sniffing.
- Content-Security-Policy (CSP): enter a complete policy. Leave it empty to send no CSP header.
These four headers only take effect when the 安全响应头 (Security headers) toggle is on.
CORS and custom headers
CORS(跨域资源共享) (CORS) lets you set:
- Allowed origins, one per line, with
*meaning any origin - Allowed methods
- Allowed request headers
- Exposed response headers
- Whether credentials are allowed
- The preflight max-age
Credentials cannot be allowed together with the origin
*.- Allowed origins, one per line, with
自定义响应头 (Custom response headers): set overrides a header of the same name, add appends a value (repeatable), and remove deletes a header such as
X-Powered-By.
On Free and Starter sites, every response carries Server: YeapCDN/2.0, and any customization or removal of the Server header is ignored. Pro and Enterprise sites can set or remove the Server header.
Origin CA certificates
Origin CA certificates are issued by the platform and installed on your origin server to encrypt the connection from the edge to your origin. Only Yeap Cloud CDN uses them, and browsers do not trust them, so never use one as a visitor-facing certificate.
To issue one:
- In the Origin CA 证书 (Origin CA certificates) card, click 签发证书 (Issue certificate).
- Fill in the dialog:
- 域名 (SANs) (Hostnames): defaults to
example.comand*.example.com. - 密钥类型 (Key type): ECC P-256 (recommended), RSA 2048 or RSA 4096.
- 有效期 (Validity): 7 days to 15 years. The default is 15 years.
- 域名 (SANs) (Hostnames): defaults to
- Copy and store the certificate and private key right away. The private key is shown only once. You cannot view it again after closing the dialog.
- Install the certificate and key in your origin's web server.
- Set the site's encryption mode to 完全 (Full).
If you need the CA chain on your origin, click 下载 CA 根证书 (Download CA root certificate). From the certificate list you can view, revoke and delete certificates.
Full (strict) validates origin certificates against publicly trusted CAs. Use Full mode for origins that use an Origin CA certificate.
Related
- Hostnames and origin protocol: Add a site
- Override HTTPS redirects or origin encryption for specific paths: Page rules