How to configure HTTPS
Hypertext Transfer Protocol over Secure Socket Layer (HTTPS) is a secure channel for Hypertext Transfer Protocol (HTTP). In simple terms, HTTPS is the secure version of HTTP. It works by securing HTTP communications with the SSL/TLS protocol. The security of HTTPS is based on SSL/TLS.
Benefits
HTTPS encrypts critical user information during transmission. This prevents security risks, such as information leaks from captured session IDs or cookies. It also verifies data integrity to prevent man-in-the-middle (MITM) attacks, such as DNS hijacking or content tampering. Alibaba Cloud Content Delivery Network (CDN) offers an HTTPS secure acceleration solution. To use it, you must enable HTTPS and upload your certificate and private key. You can then manage your certificate by viewing, disabling, enabling, or editing it.
To use Server Name Indication (SNI) for origin fetch, you can submit a ticket.
How it works
When you enable HTTPS in the Visual Edge Computing Service console, requests between users and Alibaba Cloud CDN points of presence (POPs) are encrypted. However, requests from CDN POPs to your origin server depend on your origin server's configuration. For end-to-end encryption, you must also configure and enable HTTPS on your origin server. The HTTPS encryption flow is as follows:
The client initiates an HTTPS request.
The server generates a public key and a private key. You can create these yourself or request them from a professional organization.
The server sends the corresponding public key certificate to the client.
The client parses the certificate to verify its authenticity.
If the certificate is authentic, the client generates a random number (the key). It then encrypts this random number with the public key and sends it to the server.
If the certificate is not authentic, the SSL handshake fails.
NoteAuthenticity checks include verifying that the certificate is not expired, the issuing Certificate Authority (CA) is trusted, the issuer's digital signature is valid, and the domain name on the certificate matches the server's domain name.
The server uses its private key to decrypt the message and obtain the random number (the key).
The server uses this key to encrypt the data for transmission.
The client uses the same key to decrypt the encrypted data from the server and access the information.
Notes
Configuration
You can enable or disable HTTPS secure acceleration:
You can modify the certificate. By default, the system accepts both HTTP and HTTPS requests. You can also configure a force redirect from HTTP to HTTPS.
After you disable the feature, the system no longer supports HTTPS requests and does not retain the certificate or private key information. To enable HTTPS again, you must re-upload the certificate and private key.
You can view the certificate, but you cannot view the private key because it is sensitive information. You must keep your certificate information secure. You can update the certificate, but exercise caution. An updated HTTPS certificate takes effect across the entire network in approximately one minute.
Billing
HTTPS secure acceleration is a value-added service. After you enable this service, you are billed based on the number of HTTPS requests. For more information about billing, see HTTPS Billing Details.
HTTPS is billed separately based on the number of requests. These charges are not included in the bandwidth or traffic costs for Visual Edge Computing Service. Ensure your account has a sufficient balance before you enable the HTTPS service to avoid service disruptions due to overdue payments.
Certificates
To enable HTTPS secure acceleration for a domain name, you must upload a certificate and a private key. Both must be in PEM format.
NoteThe underlying CDN for Visual Edge Computing Service uses Tengine, which is based on Nginx. Therefore, only PEM-formatted certificates that are compatible with Nginx are supported. For more information, see Certificate formats and conversion methods.
Only SSL/TLS handshakes that include SNI information are supported.
The certificate you upload must match the private key. Otherwise, a verification error occurs.
Password-protected private keys are not supported.
Procedure
Purchase a certificate. To enable HTTPS secure acceleration, you need a certificate that matches your accelerated domain name. You can apply for a free certificate or purchase an advanced certificate in the Certificate Management Service console.
Log on to the Visual Edge Computing Service console. Go to Storage Management, select a space, and view the domain names. Select a playback domain name and click Domain Name Configuration.
Choose HTTPS Settings > HTTPS Certificate and click Modify Configuration.
In the HTTPS Settings dialog box, enable HTTPS Certificate.
Select a certificate. You can choose from the following certificate types: Alibaba Cloud Security, Custom, and Personal Test Certificate (Free Edition). Only the PEM certificate format is supported. For more information, see Certificate Format Description.
You can select an Alibaba Cloud Security certificate. If a suitable certificate is not in the list, you can upload a custom certificate. Set a name for the certificate, then upload the certificate content and private key. The certificate is saved in the Certificate Service of Alibaba Cloud Security, where you can view it in My Certificates.
You can also select a Personal Test Certificate (Free Edition). This is a free domain validated (DV) SSL Certificate from DigiCert provided by Alibaba Cloud. The Personal Test Certificate (Free Edition) for CDN applies only to the CDN HTTPS secure acceleration service. You cannot manage this certificate or view its public and private keys in the Alibaba Cloud Security console. After you configure the certificate, it takes approximately 10 minutes to take effect.
Verify that the certificate is active. After the certificate takes effect, which takes approximately one minute, you can access your resources using HTTPS. If a green HTTPS icon appears in your browser, the connection is private and HTTPS secure acceleration is working.
NoteTo replace a certificate:
To switch to a Personal Test Certificate (Free Edition) or an Alibaba Cloud Security certificate, select the new certificate type on the HTTPS Settings page.
To switch to a custom certificate, select Custom on the HTTPS Settings page. Then, enter the name and content of the new certificate in the corresponding fields and submit the information.