Configure the TLS protocol version for a certificate
TLS protocol versions include TLS v1.0 (disabled), TLS v1.1, TLS v1.2, and TLS v1.3. A higher TLS version provides better HTTPS security, but higher versions have poorer browser compatibility. This topic describes how to set the TLS protocol version on an Alibaba Cloud product or a self-managed web server to balance security and compatibility.
Deploy certificates on Alibaba Cloud products
You can set the TLS protocol version through the console when you deploy certificates on the following Alibaba Cloud products. The following section provides brief operation steps. For complete instructions, click the corresponding document link.
Anti-DDoS Proxy
Operation steps
Log on to the Anti-DDoS Proxy console.
In the top navigation bar, select the region of your instance.
Anti-DDoS Proxy (Chinese Mainland): Choose the Chinese Mainland region.
Anti-DDoS Proxy (Outside Chinese Mainland): Choose the Outside Chinese Mainland region.
In the left-side navigation pane, choose .
On the Website Config page, find the target domain name and click Edit in the Actions column.
On the Modify Website Configurations tab, update the TLS Security Settings for the international standard HTTPS certificate. For more information, see Customize the TLS security policy for an HTTPS server certificate.
Web Application Firewall
Operation steps
-
Log on to the Web Application Firewall 3.0 console. From the top menu bar, select the resource group and region (Chinese Mainland or Outside Chinese Mainland) for the WAF instance.
-
In the left navigation pane, click Onboarding.
On the CNAME Record tab, click Default SSL/TLS Settings above the list.
In the Default SSL/TLS Settings dialog box, set the default TLS protocol version in WAF. Complete the following configurations and click OK.
Parameter
Description
HTTPS Upload Type
Upload an SSL certificate. The procedure is the same as uploading a domain name certificate. See Upload a certificate.
TLS Version
Select the TLS protocol version to enable. Options:
TLS 1.0 and Later (Best Compatibility and Low Security) (default)
TLS 1.1 and Later (High Compatibility and High Security)
TLS 1.2 and Later (High Compatibility and Best Security)
To enable TLS 1.3, select Support TLS 1.3.
Cipher Suite
Select the cipher suite to enable. Options:
All Cipher Suites (High Compatibility and Low Security) (default)
Custom Cipher Suite (Select It based on protocol version. Proceed with caution.)
For supported custom cipher suites, see Cipher suites supported by WAF.
For more information, see Add a website to WAF using a CNAME.
SLB
Operation steps
When you create and configure an HTTPS listener for a guaranteed-performance SLB instance, you can select a TLS security policy. On the Certificate Management Service wizard page, click Modify next to Advanced Settings and select a TLS security policy. The following steps use Classic Load Balancer (CLB) as an example.
The SLB product family includes Application Load Balancer (ALB), Network Load Balancer (NLB), and Classic Load Balancer (CLB). Choose the appropriate SLB product based on your requirements.
Log on to the CLB console.
In the top navigation bar, select the region where your instance is deployed.
On the Instances page, find the target instance and click Configure Listener in the Actions column.
On the Protocol & Listener wizard page, set Select Listener Protocol to HTTPS. Configure the remaining parameters and click Next. For details on how to configure other parameters, see Add an HTTPS listener.
On the Certificate Management Service wizard page, select an uploaded server certificate, or click Create Server Certificate to upload or purchase a certificate. For certificate-related information, see Create a Certificate.
Click Modify next to Advanced Settings and select a TLS Security Policy.
NoteOnly guaranteed-performance instances support TLS security policies.
A TLS security policy includes supported TLS protocol versions and the corresponding cipher suites. For more information, see TLS security policies.
Complete the remaining wizard pages and click Next. For the full configuration reference, see Add an HTTPS listener for a CLB instance.
For more information, see Add an HTTPS listener.
CDN
Operation steps
Before you proceed, make sure that you have configured an HTTPS certificate. For more information, see Configure an HTTPS certificate.
TLS v1.0, TLS v1.1, TLS v1.2, and TLS v1.3 are enabled by default.
-
Log on to the CDN console.
-
In the left navigation pane, click Domain Names.
-
On the Domain Names page, find the target domain name and click Manage in the Actions column.
-
In the domain's navigation pane, click HTTPS.
In the Configure TLS Cipher Suite and Version section, select a cipher suite and enable the corresponding TLS versions as needed.
For example, disable TLSv1.0 and TLSv1.1, and enable TLSv1.2 and TLSv1.3.
The following cipher suites are supported. Select as needed:
All Cipher Suites (Default): lower security, higher compatibility. For supported encryption algorithms, see Default TLS encryption algorithms for CDN.
Enhanced Cipher Suite: higher security, lower compatibility. Supported encryption algorithms:
TLS_AES_256_GCM_SHA384
TLS_AES_128_GCM_SHA256
TLS_CHACHA20_POLY1305_SHA256
ECDHE-ECDSA-CHACHA20-POLY1305
ECDHE-RSA-CHACHA20-POLY1305
ECDHE-ECDSA-AES128-GCM-SHA256
ECDHE-RSA-AES128-GCM-SHA256
ECDHE-ECDSA-AES128-CCM8
ECDHE-ECDSA-AES128-CCM
ECDHE-ECDSA-AES256-GCM-SHA384
ECDHE-RSA-AES256-GCM-SHA384
ECDHE-ECDSA-AES256-CCM8
ECDHE-ECDSA-AES256-CCM
ECDHE-ECDSA-ARIA256-GCM-SHA384
ECDHE-ARIA256-GCM-SHA384
ECDHE-ECDSA-ARIA128-GCM-SHA256
ECDHE-ARIA128-GCM-SHA256
Custom Cipher Suite: Select cipher suites as needed.
For TLS protocol version descriptions, see Background information.
For more information, see Configure TLS versions and cipher suites.
DCDN
Operation steps
Before you proceed, make sure that you have configured an HTTPS certificate. For more information, see Configure an HTTPS certificate.
-
Log on to the DCDN console.
-
In the left-side navigation pane, click Domain Names.
-
On the Domain Names page, find the target domain name and click Configure.
-
In the left-side navigation tree of the domain name, click HTTPS Settings.
In the Configure TLS Cipher Suite and Version section, select a cipher suite and enable the corresponding TLS versions as needed.
NoteBy default, TLSv1.0, TLSv1.1, TLSv1.2, and TLSv1.3 are enabled. Click Modify Configuration to make changes.
All Cipher Suites (Default): lower security, higher compatibility. For supported encryption algorithms, see Default TLS encryption algorithms supported by DCDN.
Enhanced Cipher Suite: higher security, lower compatibility. Supported encryption algorithms:
TLS_AES_256_GCM_SHA384
TLS_AES_128_GCM_SHA256
TLS_CHACHA20_POLY1305_SHA256
ECDHE-ECDSA-CHACHA20-POLY1305
ECDHE-RSA-CHACHA20-POLY1305
ECDHE-ECDSA-AES128-GCM-SHA256
ECDHE-RSA-AES128-GCM-SHA256
ECDHE-ECDSA-AES128-CCM8
ECDHE-ECDSA-AES128-CCM
ECDHE-ECDSA-AES256-GCM-SHA384
ECDHE-RSA-AES256-GCM-SHA384
ECDHE-ECDSA-AES256-CCM8
ECDHE-ECDSA-AES256-CCM
ECDHE-ECDSA-ARIA256-GCM-SHA384
ECDHE-ARIA256-GCM-SHA384
ECDHE-ECDSA-ARIA128-GCM-SHA256
ECDHE-ARIA128-GCM-SHA256
Custom Cipher Suite: Select cipher suites as needed.
For more information, see Configure TLS version control.
If you have any questions during configuration, contact the business manager for the corresponding product.
Deploy certificates on self-managed web servers
To deploy a certificate on a self-managed web server, modify the ssl_protocols parameter in the server configuration file to enable or disable specific TLS protocol versions. For example, to support only TLS v1.1 and TLS v1.2, set ssl_protocols to TLSv1.1 TLSv1.2. To enable TLS v1.3, set ssl_protocols to TLSv1.1 TLSv1.2 TLSv1.3.
The following steps use Nginx as an example to describe how to modify the supported TLS protocol version.
Open the Nginx configuration file
The Nginx configuration file is usually located at /etc/nginx/nginx.conf or in a .conf file under the /etc/nginx/conf.d/ directory. Use the following command to open the configuration file:
sudo nano /etc/nginx/nginx.confIf you use a separate site configuration file, the path may be as follows:
sudo nano /etc/nginx/sites-available/defaultModify the ssl settings in the server block
Find the server block related to HTTPS, and add or modify the ssl_protocols line to specify the supported TLS protocol versions. The following example enables TLS 1.2 and TLS 1.3. Make sure that your clients support the configured TLS protocol versions, otherwise connection failures may occur.
server {
listen 443 ssl;
server_name yourdomain.com;
# Paths to the SSL certificate and key
ssl_certificate /path/to/your_certificate.crt;
ssl_certificate_key /path/to/your_private.key;
# Supported SSL/TLS protocol versions
ssl_protocols TLSv1.2 TLSv1.3;
# Optional: restrict to stronger cipher suites
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
location / {
root /var/www/html;
index index.html index.htm;
}
}Restart the Nginx service
After saving the changes, run the following command to restart the Nginx service and apply the configuration:
sudo systemctl reload nginxOr use:
sudo service nginx restartAfter completing the preceding steps, the TLS protocol version on the Nginx server is modified.
Verify that the TLS protocol version is set successfully
Run the following command to test the TLS configuration of your server (replace
your_ipwith the actual IP address):sudo openssl s_client -connect your_ip:443Check the protocol version and certificate information in the output to confirm that the TLS configuration has taken effect. If the expected TLS protocol version appears in the output, the configuration is successful.
Post-Handshake New Session Ticket arrived: SSL-Session: Protocol : TLSv1.3 Cipher : xxx Session-ID: xxx Session-ID-ctx: Resumption PSK: xxx PSK identity: None PSK identity hint: None SRP username: None TLS session ticket lifetime hint: 7200 (seconds) TLS session ticket:
As security standards evolve, we recommend that you periodically review and update your encryption configuration to keep your server secure.