{"id":8987,"date":"2022-10-30T22:01:07","date_gmt":"2022-10-30T21:01:07","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=8987"},"modified":"2024-11-15T15:11:03","modified_gmt":"2024-11-15T14:11:03","slug":"openssl-create-a-selfsigned-certificate","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/openssl-create-a-selfsigned-certificate\/","title":{"rendered":"openssl: Create a selfsigned certificate"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_8987 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_8987')){$('.twoclick_social_bookmarks_post_8987').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"openssl%3A%20Create%20a%20selfsigned%20certificate\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Acreating%20selfsigned%20certificate%20with%20openssl%20is%20one%20step%20%3A-%29%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/openssl-create-a-selfsigned-certificate\\\/\",\"post_id\":8987,\"post_title_referrer_track\":\"openssl%3A+Create+a+selfsigned+certificate\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>creating selfsigned certificate with openssl is one step \ud83d\ude42<br \/>\n<!--more--><\/p>\n<p>This command creates a 4096 Bit key ( myKey.key ) and the corresponding selfsigned public key (myCert.pem). <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmichael@debdev ~ # openssl req -x509 \\\r\n-newkey rsa:4096 \\\r\n-keyout myKey.key \\\r\n-out myCert.pem \\\r\n-sha256 \\\r\n-days 365 \\\r\n-batch \\\r\n-nodes \\\r\n-subj &quot;\/C=DE\/ST=Franken\/L=Nuremburg\/O=my Organizaton\/OU=My Department\/CN=myHostname.myDomain.org\/emailAddress=myEMailAddress@myDomain.org&quot;\r\n<\/pre>\n<p>and with keyusage and extented key usage<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nopenssl req -x509 -newkey rsa:2048 -keyout private.key -out cert.pem -days 365 -nodes -subj &quot;\/CN=myServer.myDomain.org&quot; -addext &quot;keyUsage=keyEncipherment,dataEncipherment&quot; -addext &quot;extendedKeyUsage=serverAuth&quot;\r\n<\/pre>\n<p>If you don&#8217;t want to set a passphrase on the private key omit the -nodes switch.<\/p>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, creating selfsigned certificate with openssl is one step \ud83d\ude42<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[635,84,547,83],"class_list":["post-8987","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-build","tag-certificate","tag-openssl","tag-selfsigned"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/8987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=8987"}],"version-history":[{"count":3,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/8987\/revisions"}],"predecessor-version":[{"id":9932,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/8987\/revisions\/9932"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=8987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=8987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=8987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}