{"id":1897,"date":"2015-08-20T10:11:57","date_gmt":"2015-08-20T09:11:57","guid":{"rendered":"http:\/\/denbeke.be\/blog\/?p=1897"},"modified":"2015-08-20T10:12:49","modified_gmt":"2015-08-20T09:12:49","slug":"creating-a-self-signed-ssl-certificate-on-linux","status":"publish","type":"post","link":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/","title":{"rendered":"Creating a self-signed SSL certificate on Linux"},"content":{"rendered":"<p>The exact commands for generating a self-signed SSL certificate on Linux is something I always forget, so here they are:<\/p>\n<h3>Generating a private key<\/h3>\n<p>First you need to generate a private key. This private key\u00a0will be the only key that can decrypt your SSL traffic.<\/p>\n<pre><code>$ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048\r\n$ openssl rsa -passin pass:x -in server.pass.key -out server.key\r\n$ rm server.pass.key<\/code><\/pre>\n<h3>Generating a CSR (Certificate Signing Request)<\/h3>\n<p>Using the private key you&#8217;ve generated seconds ago, you must\u00a0now create a CSR (Certificate Signing Request). In most cases you can just use the default values for everything except the common name. The common name is usually the domain of your website.<\/p>\n<pre><code>$ openssl req -new -key server.key -out server.csr<\/code><\/pre>\n<h3>Signing the certificate<\/h3>\n<p>Normally you would pass the CSR to a CA (Certificate Authority) who would sign it for you. But using the following command\u00a0you\u00a0sign the certificate yourself.<\/p>\n<pre><code>$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The exact commands for generating a self-signed SSL certificate on Linux is something I always forget, so here they are: Generating a private key First you need to generate a private key. This private key\u00a0will be the only key that can decrypt your SSL traffic. $ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 $ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[227],"tags":[259,186,198,212,228],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.6.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating a self-signed SSL certificate on Linux &ndash; DenBeke<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a self-signed SSL certificate on Linux &ndash; DenBeke\" \/>\n<meta property=\"og:description\" content=\"The exact commands for generating a self-signed SSL certificate on Linux is something I always forget, so here they are: Generating a private key First you need to generate a private key. This private key\u00a0will be the only key that can decrypt your SSL traffic. $ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 $ [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"DenBeke\" \/>\n<meta property=\"article:published_time\" content=\"2015-08-20T09:11:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-08-20T09:12:49+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:site\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"1 minute\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/denbeke.be\/blog\/#website\",\"url\":\"https:\/\/denbeke.be\/blog\/\",\"name\":\"DenBeke\",\"description\":\"Mathias Beke\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/denbeke.be\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/#webpage\",\"url\":\"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/\",\"name\":\"Creating a self-signed SSL certificate on Linux &ndash; DenBeke\",\"isPartOf\":{\"@id\":\"https:\/\/denbeke.be\/blog\/#website\"},\"datePublished\":\"2015-08-20T09:11:57+00:00\",\"dateModified\":\"2015-08-20T09:12:49+00:00\",\"author\":{\"@id\":\"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc\",\"name\":\"Mathias Beke\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/denbeke.be\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/015ba35e6ce4f5859e3888ca99807575?s=96&d=mm&r=g\",\"caption\":\"Mathias Beke\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1897"}],"collection":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/comments?post=1897"}],"version-history":[{"count":2,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1897\/revisions"}],"predecessor-version":[{"id":1899,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1897\/revisions\/1899"}],"wp:attachment":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/media?parent=1897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/categories?post=1897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/tags?post=1897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}