Skip to main content

Custom Certificate

In the HTTPS Settings of the Arvancloud panel, you can also use certificates that you have previously obtained and installed on the origin server hosting your site.

To upload a custom certificate, after enabling HTTPS, click Private Certificate, and on the page that opens, enter your certificate's CRT, Key, and Bundle files.

To do this, you need your .crt file and your private key. Below, you will learn how to prepare an SSL/TLS certificate in PEM format and build a certificate trust chain.

Preparing an SSL/TLS Certificate in PEM Format​

PEM is a file storage format for keeping cryptographic keys and certificates. The full name of this format is Privacy-Enhanced Electronic Mail, and it is the most widely used storage format in cryptography, especially in open-source systems.

Unlike most storage standards for cryptographic files, which store content in binary, the PEM format uses base64 for encoding, which makes the file easier to move and read.

Although file extensions are not very important in open-source systems, PEM files usually use the .key extension if they contain a private key, and the .cer, .crt, or .pem extension if they contain a certificate.

You can easily open PEM files with a text editor such as Notepad or vim and check their contents.

The contents of a private key look like this:

-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCuaGs3MHEOUMvOv7QLx1cAgx7BDMHE0e
q70/A+JZlYjDL7IAcoubgibfRWyEPombDF/TtnOzuYXuNTtkGVK+iOI3HbTgVANOrhIhTO91Vh3MDBftlN
dzsYg4Ct/dZfvwGixgVfOza5nYcPSFJ5r89fre1EV/3QA3m+oPYimejcTCwEcByxxP7unmoxR9wJMYCmF3
IOtRKGMhCnIbmIRwvaQ0yeCk9vh4WoZBbqJx4pVXmqz5D4IfDt2E41NiecWVoNHMTEF9xE2Few3tPyfMMt
qQH713DiVNmLBjHkJLK8a/ev2NjFMg8KTZ0hlVyaeBZDPz0iNk3iaeXfpspZ42kPAgMBAAECggEANcqEzu
fE5spqoaCkskFQBxtpv9bkaITp5fZvEWvdSN8s1iFBtADb1tqc0qs/rpzAVcBNswAk2FDjwizjO1PojPZH
poEAw5XOn5M4YcEM93rzhHpQIUFV27CrXn58wNkTcxWqEH4d2c/JGSCQN3HO/s6Q8FRHNwHraa0RXQilNl
RROKSyDZTMyTOB0zBxXR5eJ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VATE KEY-----

A sample PEM file containing a certificate has a structure like this:

-----BEGIN CERTIFICATE-----
MIICLDCCAdKgAwIBAgIBADAKBggqhkjOPQQDAjB9MQswCQYDVQQGEwJCRTEPMA0GA1UEChMGR251VExTMSU
wIwYDVQQLExxHbnVUTFMgY2VydGlmaWNhdGUgYXV0aG9yaXR5MQ8wDQYDVQQIEwZMZXV2ZW4xJTAjBgNVBA
MTHEdudVRMUyBjZXJ0aWZpY2F0ZSBhdXRob3JpdHkwHhcNMTEwNTIzMjAzODIxWhcNMTIxMjIyMDc0MTUxW
jB9MQswCQYDVQQGEwJCRTEPMA0GA1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2VydGlmaWNhdGUg
YXV0aG9yaXR5MQ8wDQYDVQQIEwZMZXV2ZW4xJTAjBgNVBAMTHEdudVRMUyBjZXJ0aWZpY2F0ZSBhdXRob3J
pdHkwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARS2I0jiuNn14Y2sSALCX3IybqiIJUvxUpj+oNfzngvj/
Niyv2394BWnW4XuQ4RTEiywK87WRcWMGgJB5kX/t2no0MwQTAPBgNVHRMBAf8EBTADAQH/MA8GA1UdDwEB/
wQFAwMHBgAwHQYDVR0OBBYEFPC0gf6YEr+1KLlkQAPLzB9mTigDMAoGCCqGM49BAMCA0gAMEUCIDGuwD1KP
yG+hRf88MeyMQcqOFZD0TbVleF+UsAGQ4enAiEAl4wOuDwKQa+upc8GftXE2C//4mKANBC6It01gUaTIpo=
-----END CERTIFICATE-----

Converting Other Formats to PEM​

Depending on where you bought your certificate or how you generated it, its default format varies. In most cases, your certificate is in PEM format by default and needs no changes. But if you use formats such as PFX (PKCS#12) or P7B (PKCS#7), you can easily convert it to PEM. You can use online tools such as SSL Shopper or OpenSSL commands for this.

Note that PFX files contain both the private key and the certificate, so you can extract both the private key and the certificate from them.

Convert DER to PEM​
openssl x509 -inform der -in certificate.cer -out certificate.pem
Convert P7B to PEM​
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.pem
Convert PFX to PEM​
openssl pkcs12 -in certname.pfx -nokeys -out certificate.pem openssl
pkcs12 -in certname.pfx -nocerts -out private.key -nodes

Building a Certificate Trust Chain​

For an SSL/TLS certificate to work correctly and for your website's content to be shown over HTTPS without warnings in all browser versions, on all operating systems, and on devices such as phones and tablets, you need to create a complete SSL certificate trust chain instead of uploading your certificate file as is.

If you haven't yet converted your certificate file to PEM format, first convert it as described in the Preparing an SSL/TLS Certificate in PEM Format section above.

Required Files​

When you buy an SSL/TLS certificate, besides the private key file and the certificate file, you receive several other files. One of these files is the root certificate, and 1 to 3 other files are intermediate certificates.

If you don't have access to the root and intermediate files, you can usually download them easily from the website of the company that issued the certificate.

Creating the SSL Certificate Trust Chain File​

To create the trust chain file, you can easily use a text editor such as vim or Notepad. Then put the website's certificate, the intermediate certificate, and the root certificate in one file in the following order:

—---BEGIN CERTIFICATE---—
(Your Primary SSL certificate: yourwebsite.crt)
—---END CERTIFICATE---—
—---BEGIN CERTIFICATE---—
(Your Intermediate certificate: INTERMEDIATE.crt)
—---END CERTIFICATE---—
—---BEGIN CERTIFICATE---—
(Your Root certificate: Root.crt)
—---END CERTIFICATE-----