Certificate format requirements
Before you enable the HTTPS service, you must configure a certificate. You can select a personal test certificate (Free Edition) or a commercial certificate from Certificate Management Service, or upload a custom certificate. Custom certificates must be in the PEM format.
Certificate format requirements
Alibaba Cloud Certificate Management Service provides the following types of certificates.

Alibaba Cloud Content Delivery Network (CDN) uses Nginx. The .pem file contains the certificate and the .key file contains the private key.
The certificate file must contain the full encapsulated certificate chain. If you upload a custom certificate, you must follow the concatenation rules. Certificates from Certificate Management Service are typically issued by an intermediate certificate authority (CA). Root CAs do not typically issue certificates directly.
In a Linux environment, a certificate in the PEM format appears as follows:
-----BEGIN CERTIFICATE-----
MIIE+TCCA+GgAwIBAgIQU3O6HIX4KsioTW1s2A2krTANBgkqhkiG9w0BAQUFADCb
tTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTD1ZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTswOQYDVQQLEzJUZXJtcyBvZiB1c2Ug
YXQgaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JwYSAoYykxMDEvMC0GA1UEAxMm
VmVyaVNpZ24gQ2xhc3MgMyBTZWN1cmUgU2VydmVyIENBIC0gRzMwHhcNMTQxMDA4
MDAwMDAwWhcNMTUxMDA5MjM1OTU5WjBqMQswCQYDVQQGEwJVZnTMBEGA1UECBMK
V2FzaGluZ3RvbjEQMA4GA1UEBxQHU2VhdHRsZTEYMBYGA1UEChQPQW1hem9uLmNv
bSBJbmMuMR0wGwYDVQQDFBFwYOuW1lhem9uYXdzLmNvbSBTCBnzaNBgkqhkiG9w0B
AQEFAAOBjQAwgYkCgYEA3Xb0EGea2dB8QGEcUwL.cEpwvGawEkLdLZmGL1rQJZdee
3vaF+zTm8QwSAdkZGr/RwXYtxp04xvQXMmln+9YmksHmCZdruCrW1eN/P9WbFqMMZ
X964CjVov3NrF5AuuU8jgtw0yu//C3hWn0uTVDg76626gg0oJSaj4B2Rn0MnVcC
AwEAAaO0CAdEwggHNMAkGA1UdEwQCMAAwCwYDVR0PBAQDABgWMEUGA1UdhMQ+MDw
0Qa4oDAGNGH0dHAGLy9TV1LNzMn0uLtRzItY3JsLnZ1cmxzaWduLmNvbnVb9TV1JT
ZWN1cmVHVH5jcmwRAYDVR0gBD0wOzA5BgtghkgBhvhFAQcXAzAqMCgGCCsGAQUF
BwIBFhxodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhMB0GA1UdJQQWMBQGCCSG
AQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBS1 7wsRzsBBA6NK5ZBIshzgVy19
RzB2BggrBgEFBQcBAQRqMGgwJAYIKwYBBQUHMAGGGHh0dHA6Ly9vY3NwLnZlcmlz
aWduLm5ldDBBBggrBgEFBQcwAoY0aHR0cDovL1NWUN1NY3VyZS1HMi1haWEudmVy
aXNpZ24uY29tL1NWUN1NY3VyZUcyLmNlcjBuBgNVHREEZzBlghBEcBARiMGChXqBcMFow
WDBWFglpbWFnZS9naWYWIytIMAFMaCGBSs0AwIaRBBRLa7koIgYMu9BSOJsprEsHiyeF
GDAmFiRodHRwOi8vBG9nby5225XJpc2lnbi5jb20vdnMSSMwYWYvNDQYJKoZI
hvcNAQEFBQADggEBALpFBxeG782QstTtGwEE9zBcVCuKjrs13dWK1dFiq30P4y/Bi
ZBYEywBt8z2NuYFUE25Ub/zmvmpe7p0G76tqm08bRp/4qkJoiSesHJvFgJ1mksr3IQ
3gaE1aN2BSUTHxcGLn9N4F09hYwwbeEZaCxfgBiLdEIodNwzcvGJ+2LdlDWGJOGrNI
NM856xjqhJCPxYzk9buuCL1B4Kzu0CfbexzZ/iEgYV+DiuTxcfA4uhmMDSe0nynbn
1qiWRk45Om0COnqH4ly4P1Lx0o2t4A/DI1l82Nzct/Qf169a2Lf6vc9rF7BELTOe5Y
R7CKx7fc5xRaeQdyGj/dJevm9BF/mSdnc1S5vas=
-----END CERTIFICATE-----
Certificate rules: The certificate content must include the header -----BEGIN CERTIFICATE----- and the footer -----END CERTIFICATE-----. Each line must contain 64 characters, but the last line can contain fewer than 64 characters.
Certificate chain issued by an intermediate authority:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
Certificate chain rules: Do not include empty lines between certificates. Each certificate must adhere to the specified format.
RSA private key format requirements
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAvZiSSSChk67bmt8mFykAxQ1tKCYukwBiWZwk0StFEbTWHy8K
tTHSfD1u9TL6qycrHEG7cjYD4DK+kVIHU/0f/pUWj9lLnnrE3W34DaVz2dKA00I3A
w9w5grqFJMJcLva2zkhNKA1+tNPSCPJoo9DDrP7wx7cQx7LbMb0dfZ8858KIoluz2
/fD0XXyuWOqalePZtk9Qnjn957ZEPhjt1UpVZuhS3409DDM/t3JT1l8aaNYWhrRnp
jNcz0Z6XQGF1rZG/Ve520X6rb5dUYpdcfXZn5NWMGxYg8aLL7UDHDHHP1I4AYsat:dG
zSTMPnmE f8y2PUYudtTLxgMVAovJr09Dq+4D5m3QIDAQAB0IBAG168Z/nnFyRf1i
laF6+Wen8ZvNqkm0hWdMIJh1Vp1F174//8Qyea/EvUtUuJHyB6T/2PPZQoNVhxe35
cgQ93Tx424WGpCWuHsF xewfbAYGF3ur8WOqaU007BXaxaKHHCnmMG7dGyoUloWRu
S+yXLrpVzH1YKuH8TTS3uddGTeTWi77r+8dkGi9KSA2Q0pRa19B7t+CHKIZm6ybs/2
06W/d2HZA4YaxwkTY1LKGHjoieYs111aH1aJVlCVgTc3+LzG2PipM7I+K0NhC5eswvm
i5x9h/0T/ujZsyY9P0PAbzvy80t0+tGex0M0765sv0KVhKFVVlJLUnhFe0WcqFCD
xqnhxkEcGYEA+PftNb6eyXL+/Y/U8NNv2fg3+rSCms0j98g9+4yZzF5GhqgHu0edA
XZTHrJ9u6B1XE1arpi jVs/WHmFhYST5m6DbDd7D5lLtByOBY4cPTRhziFTK+8AkIMXA
G05u0UiWsq028hn1X41ov2cW902Qa/HC9udeyQotP4MsNMJWgpBV7t8C0CgYEAwNf
0F+/jUjt0HoyxCh4SIAqk4U0o4++hBCQbKCVxSqCz4mRyTalWzFEG8/AR3Md2rhmZi
GrnJ5dfre7uY+JsQFX2Q5JjwTadlBW41ed0Sa/ukRao04UzVgnYp2aJKxtunWFffVbU
+kF72Z8JRAGaozSLvGmA8hu/GL6bgFkSkwo53ECgYB9pYK7TI7jvvnAErMt:lF2ySv
ICRKbQaB3gPSe/1CGzy1nhtaFOU0NxGeouwnLAZR0wrz7X3T2qHEDcYoJ7mK3466of
QhGLlTYnoehbYkAUtuq038Y04EhK6S/IzMzBcFrXi PKg9s8UK0Qzk1U+GSE7ootli+a
R8Xzu835EwxI6BWN1abpQBkgQ0C8t1aICLq1pIFteXOyGcNdcReLMncUhKIKcP/+xxN
R3kVL0GMZCfAdqirAjQiQWaPkh9Xbbp2eHCrb81FAWLRQ5lok79b/jVmTZMC3upd
EJ/iSWjZKPbw7hCFAeRtPhxyNTJ5idEIu9I8EQid8111giPgn0p3sE0HpDI89qZXk
aaqiMEQKBgQDK2bsnZE9yO2WHnGTeu94g1KmFrSkJMGH8pLaTi1iwi RhRYWJysZ9
BOIDxnrmwiPa9b6CtEpK80zaq28dq7xqpCs9CavQRcvO8hSHx0yyz3m9hFrzfDe02Y
NTKh1g3HHf1joNM81LHFyGRfEWWrroWSgfBudR6USRnR/6iQ11xZXw==
-----END RSA PRIVATE KEY-----
RSA private key rules:
To generate a private key locally, run the following command: openssl genrsa -out privateKey.pem 2048. In this command, privateKey.pem is your private key file. The key must start with -----BEGIN RSA PRIVATE KEY----- and end with -----END RSA PRIVATE KEY-----. You must upload the entire content, including the header and footer. Each line must contain 64 characters, but the last line can contain fewer than 64 characters.
If your private key was not generated using the preceding method and is in the following format,
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
you can run the following command to convert it: openssl rsa -in old_server_key.pem -out new_server_key.pem. Then, upload the content of new_server_key.pem with your certificate.
Methods to convert certificate formats
HTTPS secure acceleration for CDN supports only certificates in the PEM format. Certificates in other formats must be converted to the PEM format. You can use the OpenSSL tool to perform the conversion. For more information, see How to convert certificate formats.
The following sections describe how to convert common certificate formats to the PEM format.
Convert DER to PEM
The DER format is commonly used on the Java platform.
Convert a certificate: openssl x509 -inform der -in certificate.cer -out certificate.pem
Convert a private key: openssl rsa -inform DER -outform pem -in privatekey.der -out privatekey.pem
Convert P7B to PEM
The P7B format is commonly used on Windows Server and Tomcat.
Convert a certificate: openssl pkcs7 -print_certs -in incertificat.p7b -out outcertificate.cer
Copy the content from outcertificate.cer, including the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines, and then upload it as the certificate.
Convert a private key: P7B certificates do not include a private key. In the CDN console, you can enter only the certificate content and leave the private key field empty.
Convert PFX to PEM
The PFX format is commonly used on Windows Server.
Convert a certificate: openssl pkcs12 -in certname.pfx -nokeys -out cert.pem
Convert a private key: openssl pkcs12 -in certname.pfx -nocerts -out key.pem -nodes
Personal test certificate (Free Edition)
It takes 5 to 10 minutes to request a personal test certificate (Free Edition). During this time, you can choose to upload a custom certificate or use a managed certificate instead. You can switch between a custom or managed certificate and a personal test certificate (Free Edition) at any time. A personal test certificate (Free Edition) is valid for three months. It does not automatically renew upon expiration. You must request a new one. If you disable and then re-enable HTTPS settings, the system uses your existing, unexpired personal test certificate (Free Edition). If the certificate has expired when you re-enable HTTPS, the system requests a new personal test certificate (Free Edition).
Other certificate information
You can disable, enable, and modify certificates. After you disable a certificate, the system no longer stores its information. To use the certificate again, you must re-upload the certificate and private key. Only SSL/TLS with Server Name Indication (SNI) is supported. Ensure that the uploaded certificate and private key match. Certificate updates take about 10 minutes to take effect. Password-protected private keys are not supported.