HowTo: Convert SSL certificate format
The SSL certificate of the TWSC Load Balancing (HTTPs with SSL) service adopts Base64 encoding format. This document will help users to combine SSL certificate files into PKCS #12 and convert to Base64 encoding format.
Prerequisites
- Prepare the SSL certificate files provided or purchased by your organization, i.e.,
server.key
(Private Key),server.crt
(certificate file), andca-chain.crt
(Intermediate CA). - Install OpenSSL in your local machine. For Windows users, you can download Win64 OpenSSL in this website.
Convert certificate format
Linux
Open the terminal, and enter the following command to combine the 3 obtained certificate files into PKCS #12 format.
openssl pkcs12 -export -out server.p12 -inkey server.key -in server.crt -certfile ca.crt
Press the Enter key to skip the following content.
Enter Export Password:
Verifying - Enter Export Password:Then convert the combined
.p12
file into Base64 encoding.base64 server.p12 | tr -d \\n
Copy the Base64 encoded output.
Windows
Open Win64 OpenSSL Command Prompt and enter the following command to combine the 3 certificate files obtained into PKCS #12 format.
openssl pkcs12 -export -out server.p12 -inkey server.key -in server.crt -certfile ca.crt
Press the Enter key to skip the following content.
Enter Export Password:
Verifying - Enter Export Password:Convert the combined
.p12
file into Base64 encoding.openssl base64 -in server.p12 -out server.txt -A
Open the Base64 encoded output file and copy the contents of the
server.txt
file.