{"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":{"footnotes":""},"categories":[227],"tags":[259,186,198,212,228],"class_list":["post-1897","post","type-post","status-publish","format-standard","hentry","category-servers","tag-certificate","tag-server","tag-ssl","tag-ubuntu","tag-unix","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating a self-signed SSL certificate on Linux &#8211; 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 &#8211; 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=\"author\" content=\"Mathias Beke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:site\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mathias Beke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/servers\\\/creating-a-self-signed-ssl-certificate-on-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/servers\\\/creating-a-self-signed-ssl-certificate-on-linux\\\/\"},\"author\":{\"name\":\"Mathias Beke\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\"},\"headline\":\"Creating a self-signed SSL certificate on Linux\",\"datePublished\":\"2015-08-20T09:11:57+00:00\",\"dateModified\":\"2015-08-20T09:12:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/servers\\\/creating-a-self-signed-ssl-certificate-on-linux\\\/\"},\"wordCount\":133,\"commentCount\":0,\"keywords\":[\"certificate\",\"server\",\"ssl\",\"ubuntu\",\"unix\"],\"articleSection\":[\"Servers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/denbeke.be\\\/blog\\\/servers\\\/creating-a-self-signed-ssl-certificate-on-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/servers\\\/creating-a-self-signed-ssl-certificate-on-linux\\\/\",\"url\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/servers\\\/creating-a-self-signed-ssl-certificate-on-linux\\\/\",\"name\":\"Creating a self-signed SSL certificate on Linux &#8211; 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\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/servers\\\/creating-a-self-signed-ssl-certificate-on-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/denbeke.be\\\/blog\\\/servers\\\/creating-a-self-signed-ssl-certificate-on-linux\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/servers\\\/creating-a-self-signed-ssl-certificate-on-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating a self-signed SSL certificate on Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/\",\"name\":\"DenBeke\",\"description\":\"Mathias Beke\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\",\"name\":\"Mathias Beke\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"caption\":\"Mathias Beke\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a self-signed SSL certificate on Linux &#8211; DenBeke","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/","og_locale":"en_US","og_type":"article","og_title":"Creating a self-signed SSL certificate on Linux &#8211; DenBeke","og_description":"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;]","og_url":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/","og_site_name":"DenBeke","article_published_time":"2015-08-20T09:11:57+00:00","article_modified_time":"2015-08-20T09:12:49+00:00","author":"Mathias Beke","twitter_card":"summary_large_image","twitter_creator":"@MthsBk","twitter_site":"@MthsBk","twitter_misc":{"Written by":"Mathias Beke","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/#article","isPartOf":{"@id":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/"},"author":{"name":"Mathias Beke","@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc"},"headline":"Creating a self-signed SSL certificate on Linux","datePublished":"2015-08-20T09:11:57+00:00","dateModified":"2015-08-20T09:12:49+00:00","mainEntityOfPage":{"@id":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/"},"wordCount":133,"commentCount":0,"keywords":["certificate","server","ssl","ubuntu","unix"],"articleSection":["Servers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/","url":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/","name":"Creating a self-signed SSL certificate on Linux &#8211; 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"},"breadcrumb":{"@id":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/denbeke.be\/blog\/servers\/creating-a-self-signed-ssl-certificate-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/denbeke.be\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating a self-signed SSL certificate on Linux"}]},{"@type":"WebSite","@id":"https:\/\/denbeke.be\/blog\/#website","url":"https:\/\/denbeke.be\/blog\/","name":"DenBeke","description":"Mathias Beke","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/denbeke.be\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc","name":"Mathias Beke","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","caption":"Mathias Beke"}}]}},"_links":{"self":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1897","targetHints":{"allow":["GET"]}}],"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}]}}