InfoComm Asia on July 17-19 in Bangkok
Go back

How to Generate a Self-Signed Certificate

We’ve already told you how to generate a Let’s Encrypt SSL certificate on Windows and Linux. These are full-fledged certificates for use in operational environments. However, for testing purposes you may need to create a number of certificates, while verifying multiple Let’s Encrypt certificates may be inconvenient. Self-signed certificates are more suitable for mass generation.

TrueConf Server enables users to generate self-signed certificates right in the TrueConf Server control panel. If this option doesn’t suit you for some reason, or you need to generate a self-signed certificate for other TrueConf products, e.g., TrueConf Group, you can opt for the OpenSSL cryptographic library.

Installing OpenSSL and generating a certificate on Windows

  1. Visit the OpenSSL download page, download the installer for the Light version, depending on the bitness of your operating system and start the process.
  2. Once installation is complete, you need to add the path to the program as a system variable. To this end, go to Control Panel → System → Advanced System Settings → Environment Variables.How to Generate a Self-Signed Certificate 1
    In System Variables, select the Path variable and click Edit. In the pop-up window, click New and enter the path to the bin folder of your app (C:\Program Files\OpenSSL-Win64\bin by default). Click OK.

    You may need to restart your computer to apply the settings.
  3. Create a folder where you want to save the generated certificates, e.g., C:\cert.
  4. Open a command prompt (cmd) as an administrator and navigate to the previously created folder (cd /d C:\cert).
  5. Execute the following command:

    , where:
    -x509 confirms that you need a self-signed certificate
    -newkey creates a certificate key automatically
    -days sets the certificate validity period in days
    -keyout is a path (if specified) and key file name
    -out is a path (if specified) and certificate file name.

  6. Enter your country code, its name, city, company name, department name, server FQDN or your name and email.How to Generate a Self-Signed Certificate 2
  7. There will be two files in C:\cеrt:
    • certificate.crt (your certificate)
    • privateKey.key (key file).

Installing OpenSSL and generating a certificate on Linux

Let’s take a look at how to generate a self-signed certificate on Debian 10.

To execute the below commands, the operating system must have the sudo program with the user being in the corresponding group. Your Debian may not have sudo by default, but you can check for it with sudo -V command and then install if necessary using apt install sudo command (executed as root). To add a user with the login user to the sudo group, you can use sudo usermod -a -G sudo user.

Some Linux distributions come with the openssl package. To check if you have this package installed, you need to execute the openssl version command from the terminal. If you see a response like OpenSSL 1.1.0l  10 Sep 2019, you should go to Step 3.

  1. Update the packages in the system by using the console command:
  2. Install OpenSSL by entering the following command:
  3. Create a directory where you want to save the generated certificates using mkdir command, e.g., mkdir /home/$USER/cert
    $USER is an environment variable in Linux distributions; when used in commands, it’s automatically replaced with the current user’s login in the system.
  4. Go to the previously created directory by using cd command, e.g., cd /home/$USER/cert.
  5. Follow Steps 5–6 given in the section for generating certificates on Windows.How to Generate a Self-Signed Certificate 3
  6. There will be two files in /home/user_name/cert:
    • certificate.crt (your certificate)
    • privateKey.key (key file).

Still have questions? Please contact our support team directly via online chat.

Sign up for newsletter