{"id":1869,"date":"2022-10-03T22:54:38","date_gmt":"2022-10-03T22:54:38","guid":{"rendered":"https:\/\/www.qworqs.com\/?p=1869"},"modified":"2022-10-05T01:15:31","modified_gmt":"2022-10-05T01:15:31","slug":"self-signed-wildcard-security-certificate-for-apache-or-nginx","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2022\/10\/03\/self-signed-wildcard-security-certificate-for-apache-or-nginx\/","title":{"rendered":"Self signed wildcard security certificate for apache or nginx"},"content":{"rendered":"\n<p>This tutorial is done on a debian 11 system&#8230; it should work for wildcard (For all subdomains under a domain), but also for subdomains or the primary domain, obviously, all you need to do is replace the * which denotes wildcard with the subdomain of your choice, so *.qworqs.com is wildcard, yazeed.qworqs.com is a subdomain \ud83d\ude09 so let us get started<\/p>\n\n\n\n<p>Let&#8217;s encrypt has certainly revolutionized the world of SSL certificates (By making them free), but when it comes to wildcard certificates, let&#8217;s encrypt will require more than just generating the certificate, it will require a system that automatically alters DNS at your registrar, and differs from registrar to registrar.<\/p>\n\n\n\n<p>So while I am developing, and need a wildcard SSL, I can simply generate a self signed wildcard security certificate, and teach my browser to accept it, and that is that, so here is how to generate that certificate ! <\/p>\n\n\n\n<p>So let us get started, first let us create a public and private key in one go, and a folder to store them !<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/etc\/ssl\nsudo mkdir qworqs.com\nsudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/ssl\/qworqs.com\/wildcard-ss.key -out \/etc\/ssl\/qworqs.com\/wildcard-ss.crt<\/pre>\n\n\n\n<p>I will personally skip selecting a strong Diffie-Hellman group&#8230; this file though goes somewhere else in the nginx directory, and can be generated like the following, but again, I don&#8217;t need it atm.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo openssl dhparam -out \/etc\/nginx\/dhparam.pem 4096<\/pre>\n\n\n\n<p>Now you are done with creating everything you need, the next step is to install them into your nginx configuration<\/p>\n\n\n\n<p>So all you need is to add the following 2 lines into your server section within the website config file \ud83d\ude09<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    ssl_certificate \/etc\/ssl\/qworqs.com\/wildcard-ss.crt;\n    ssl_certificate_key \/etc\/ssl\/qworqs.com\/wildcard-ss.key;<\/pre>\n\n\n\n<p>Now all you need is to restart nginx, and you should get a warning in your browser, I accept the warning, then make it permanent in firefox from the settings<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Settings -> Privacy &amp; Security -> Security -> Certificates -> View Certificates... -> Servers Then switch it from temporary to permanent<\/pre>\n\n\n\n<p>And that&#8217;s that<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial is done on a debian 11 system&#8230; it should work for wildcard (For all subdomains under a domain), but also for subdomains or the primary domain, obviously, all you need to do is replace the * which denotes wildcard with the subdomain of your choice, so *.qworqs.com is wildcard, yazeed.qworqs.com is a subdomain [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-1869","post","type-post","status-publish","format-standard","hentry","category-ssl"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/1869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=1869"}],"version-history":[{"count":11,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/1869\/revisions"}],"predecessor-version":[{"id":1886,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/1869\/revisions\/1886"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=1869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=1869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=1869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}