Skip to main content

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

  1. Prepare the SSL certificate files provided or purchased by your organization, i.e., server.key (Private Key), server.crt (certificate file), and ca-chain.crt (Intermediate CA).
  2. Install OpenSSL in your local machine. For Windows users, you can download Win64 OpenSSL in this website.

Convert certificate format

Linux

  1. 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:
  2. Then convert the combined .p12 file into Base64 encoding.

    base64 server.p12 | tr -d \\n 
  3. Copy the Base64 encoded output.


Windows

  1. 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:
  2. Convert the combined .p12 file into Base64 encoding.

    openssl base64 -in server.p12 -out server.txt -A
  3. Open the Base64 encoded output file and copy the contents of the server.txt file.