{"id":19008,"date":"2021-11-12T00:38:13","date_gmt":"2021-11-11T21:38:13","guid":{"rendered":"https:\/\/trueconf.com/blog\/?p=19008"},"modified":"2025-11-25T12:37:10","modified_gmt":"2025-11-25T09:37:10","slug":"how-to-generate-a-self-signed-certificate","status":"publish","type":"post","link":"https:\/\/trueconf.com/blog\/knowledge-base\/how-to-generate-a-self-signed-certificate","title":{"rendered":"How to Generate a Self-Signed Certificate"},"content":{"rendered":"<p class=\"primary-medium-text ui-mb-sm-1\">We\u2019ve already told you how to generate a Let\u2019s Encrypt SSL certificate on <a href=\"https:\/\/trueconf.com\/blog\/knowledge-base\/how-to-create-a-lets-encrypt-certificate-on-windows.html\" target=\"_blank\" rel=\"noopener\">Windows<\/a> and <a href=\"https:\/\/trueconf.com\/blog\/knowledge-base\/how-to-create-a-lets-encrypt-certificate-on-linux.html\" target=\"_blank\" rel=\"noopener\">Linux<\/a>. 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\u2019s Encrypt certificates may be inconvenient. Self-signed certificates are more suitable for mass generation.<\/p>\n<p class=\"primary-medium-text ui-mb-sm-1\">TrueConf Server enables users to <a href=\"https:\/\/trueconf.com\/blog\/knowledge-base\/adjust-https-trueconf-server.html#How_to_create_self-signed_certificate\" target=\"_blank\" rel=\"noopener\">generate self-signed certificates<\/a> right in the TrueConf Server control panel. If this option doesn\u2019t suit you for some reason, or you need to generate a self-signed certificate for other TrueConf products, e.g., <a href=\"https:\/\/docs.trueconf.com\/group\/en\/control-panel#https-settings\" target=\"_blank\" rel=\"noopener\">TrueConf Group<\/a>, you can opt for the <a href=\"https:\/\/www.openssl.org\/\" target=\"_blank\" rel=\"noopener\">OpenSSL<\/a> cryptographic library.<\/p>\n<h2 id=\"install_on_windows\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Installing OpenSSL and generating a certificate on Windows<\/h2>\n<ul class=\"ui-list ui-list--medium\" style=\"margin-bottom: 18px;\">\n<li class=\"ui-list__item ui-list__item--num\">Visit the OpenSSL <a href=\"https:\/\/slproweb.com\/products\/Win32OpenSSL.html\" target=\"_blank\" rel=\"noopener\">download page<\/a>, download the installer for the Light version, depending on the bitness of your operating system and start the process.<\/li>\n<li class=\"ui-list__item ui-list__item--num\">Once installation is complete, you need to add the path to the program as a system variable. To this end, go to <strong>Control Panel \u2192 System \u2192 Advanced System Settings \u2192 Environment Variables<\/strong>.<a href=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2021\/11\/edit-en.png\" data-rel=\"lightbox-gallery-3oJ5maCT\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2021\/11\/edit-en-497x470.png\" alt=\"\" width=\"497\" height=\"470\" class=\"aligncenter size-medium wp-image-19029\" loading=\"lazy\" title=\"\" srcset=\"https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/edit-en-497x470.png 497w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/edit-en-192x182.png 192w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/edit-en.png 618w\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" \/><\/a><br \/>\nIn <strong>System Variables<\/strong>, select the <b>Path<\/b> variable and click <strong>Edit<\/strong>. In the pop-up window, click <strong>New<\/strong> and enter the path to the <b>bin<\/b> folder of your app (<code>C:\\Program Files\\OpenSSL-Win64\\bin<\/code> by default). Click <strong>OK<\/strong>.<\/p>\n<div class=\"accent-note accent-note--line accent-note--special ui-mb-sm-1 ui-mt-xs-3\">\n<p class=\"primary-medium-text\">You may need to restart your computer to apply the settings.<\/p>\n<\/div>\n<\/li>\n<li class=\"ui-list__item ui-list__item--num\">Create a folder where you want to save the generated certificates, e.g., <code>C:\\cert<\/code>.<\/li>\n<li class=\"ui-list__item ui-list__item--num\">Open a command prompt (<b>cmd<\/b>) as an administrator and navigate to the previously created folder (<code>cd \/d C:\\cert<\/code>).<\/li>\n<li class=\"ui-list__item ui-list__item--num\">Execute the following command:\n<pre class=\"wrap:true lang:default decode:true \">openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">, where:<br \/>\n<code>-x509<\/code> confirms that you need a self-signed certificate<br \/>\n<code>-newkey<\/code> creates a certificate key automatically<br \/>\n<code>-days<\/code> sets the certificate validity period in days<br \/>\n<code>-keyout<\/code> is a path (if specified) and key file name<br \/>\n<code>-out<\/code> is a path (if specified) and certificate file name.<\/p>\n<\/li>\n<li class=\"ui-list__item ui-list__item--num\">Enter your country code, its name, city, company name, department name, server FQDN or your name and email.<a href=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2021\/11\/create-cert-en.png\" data-rel=\"lightbox-gallery-3oJ5maCT\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2021\/11\/create-cert-en-690x307.png\" alt=\"\" width=\"690\" height=\"307\" class=\"aligncenter size-medium wp-image-19031\" loading=\"lazy\" title=\"\" srcset=\"https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/create-cert-en-690x307.png 690w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/create-cert-en-768x341.png 768w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/create-cert-en-290x129.png 290w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/create-cert-en.png 979w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/a><\/li>\n<li class=\"ui-list__item ui-list__item--num\">There will be two files in <code>C:\\c\u0435rt<\/code>:\n<ul class=\"ui-list ui-list--medium\" style=\"margin-bottom: 18px;\">\n<li class=\"ui-list__item ui-list__item--disc\"><b>certificate.crt<\/b> (your certificate)<\/li>\n<li class=\"ui-list__item ui-list__item--disc\"><b>privateKey.key<\/b> (key file).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 id=\"install_on_linux\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Installing OpenSSL and generating a certificate on Linux<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1\">Let\u2019s take a look at how to generate a self-signed certificate on Debian 10.<\/p>\n<div class=\"accent-note accent-note--line accent-note--special ui-mb-sm-1 ui-mt-xs-3\">\n<p class=\"primary-medium-text\">To execute the below commands, the operating system must have the <b>sudo<\/b> program with the user being in the corresponding group. Your Debian may not have sudo by default, but you can check for it with <code>sudo -V<\/code> command and then install if necessary using <code>apt install sudo<\/code> command (executed as <b>root<\/b>). To add a user with the login <b>user<\/b> to the <b>sudo<\/b> group, you can use <code>sudo usermod -a -G sudo user<\/code>.<\/p>\n<\/div>\n<p class=\"primary-medium-text ui-mb-sm-1\">Some Linux distributions come with the <b>openssl<\/b> package. To check if you have this package installed, you need to execute the <code>openssl version<\/code> command from the terminal. If you see a response like <code>OpenSSL 1.1.0l\u00a0 10 Sep 2019<\/code>, you should go to Step 3.<\/p>\n<ul class=\"ui-list ui-list--medium\" style=\"margin-bottom: 18px;\">\n<li >Update the packages in the system by using the console command:\n<pre class=\"lang:default decode:true \">sudo apt update &amp;&amp; sudo apt -y upgrade<\/pre>\n<\/li>\n<li class=\"ui-list__item ui-list__item--num\">Install OpenSSL by entering the following command:\n<pre class=\"lang:default decode:true \">sudo apt install openssl<\/pre>\n<\/li>\n<li class=\"ui-list__item ui-list__item--num\">Create a directory where you want to save the generated certificates using <b>mkdir<\/b> command, e.g., <code>mkdir \/home\/$USER\/cert<\/code>\n<div class=\"accent-note accent-note--line ui-mb-sm-1\">\n<p class=\"primary-medium-text\"><code>$USER<\/code> is an environment variable in Linux distributions; when used in commands, it\u2019s automatically replaced with the current user\u2019s login in the system.<\/p>\n<\/div>\n<\/li>\n<li class=\"ui-list__item ui-list__item--num\">Go to the previously created directory by using <b>cd<\/b> command, e.g., <code>cd \/home\/$USER\/cert<\/code>.<\/li>\n<li class=\"ui-list__item ui-list__item--num\">Follow Steps 5\u20136 given in the section for <a href=\"#Installing_OpenSSL_and_generating_a_certificate_on_Windows\">generating certificates on Windows<\/a>.<a href=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2021\/11\/linux-terminal-en.png\" data-rel=\"lightbox-gallery-3oJ5maCT\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2021\/11\/linux-terminal-en-690x380.png\" alt=\"\" width=\"690\" height=\"380\" class=\"aligncenter size-medium wp-image-19025\" loading=\"lazy\" title=\"\" srcset=\"https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/linux-terminal-en-690x380.png 690w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/linux-terminal-en-768x423.png 768w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/linux-terminal-en-290x160.png 290w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2021\/11\/linux-terminal-en.png 798w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/a><\/li>\n<li class=\"ui-list__item ui-list__item--num\">There will be two files in <code>\/home\/user_name\/cert<\/code>:\n<ul class=\"ui-list ui-list--medium\" style=\"margin-bottom: 18px;\">\n<li class=\"ui-list__item ui-list__item--disc\"><b>certificate.crt<\/b> (your certificate)<\/li>\n<li class=\"ui-list__item ui-list__item--disc\"><b>privateKey.key<\/b> (key file).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019ve already told you how to generate a Let\u2019s 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\u2019s Encrypt certificates may be inconvenient. Self-signed certificates are more suitable for mass generation. [&hellip;]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[260],"tags":[188,186],"class_list":["post-19008","post","type-post","status-publish","format-standard","hentry","category-knowledge-base","tag-trueconf-solutions","tag-administration","wpautop"],"_links":{"self":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/19008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/comments?post=19008"}],"version-history":[{"count":25,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/19008\/revisions"}],"predecessor-version":[{"id":40743,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/19008\/revisions\/40743"}],"wp:attachment":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/media?parent=19008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/categories?post=19008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/tags?post=19008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}