{"id":29,"date":"2018-02-06T11:07:07","date_gmt":"2018-02-06T17:07:07","guid":{"rendered":"https:\/\/tech.my-netsol.com\/?p=29"},"modified":"2018-02-06T11:07:07","modified_gmt":"2018-02-06T17:07:07","slug":"self-signed-wildcard-certificate-with-san-using-openssl-ssl","status":"publish","type":"post","link":"https:\/\/tech.my-netsol.com\/?p=29","title":{"rendered":"Self-Signed Wildcard certificate with SAN using openssl \/ SSL"},"content":{"rendered":"<p>Copy the default template of\u00a0<code>openssl.cnf<\/code>\u00a0to a writable location.<\/p>\n<p><code>cp \/System\/Library\/OpenSSL\/openssl.cnf src<\/code><\/p>\n<p>Uncomment the req_extensions = v3_req<\/p>\n<p><code>req_extensions = v3_req # The extensions to add to a certificate request<\/code><\/p>\n<p>Add\u00a0<code>subjectAltName<\/code>\u00a0to v3_req section<\/p>\n<pre><code>[ v3_req ]\n \n# Extensions to add to a certificate request\n \nbasicConstraints = CA:FALSE\nkeyUsage = nonRepudiation, digitalSignature, keyEncipherment\nsubjectAltName = @alt_names\n<\/code><\/pre>\n<p>Add the main hostname and the wildcard to a new [alt_names] section<\/p>\n<pre><code>[alt_names]\nDNS.1 = yourdomain.com\nDNS.2 = *.yourdomain.com\n<\/code><\/pre>\n<p>For example, for mydomain.com<\/p>\n<pre><code>[alt_names]\nDNS.1 = mydomain.com\nDNS.2 = *.mydomain.com\n<\/code><\/pre>\n<p>Run the following and fill all the essential information, especially the CN (Common Name):<\/p>\n<pre><code>openssl genrsa -des3 -out hostname.key 2048\nopenssl rsa -in hostname.key -out hostname-key.pem\nopenssl req -new -key hostname-key.pem -out hostname-request.csr\nopenssl x509 -req -extensions v3_req -days 365 -in hostname-request.csr -signkey hostname-key.pem -out hostname-cert.pe<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Copy the default template of\u00a0openssl.cnf\u00a0to a writable location. cp \/System\/Library\/OpenSSL\/openssl.cnf src Uncomment the req_extensions = v3_req req_extensions = v3_req # The extensions to add to a certificate request Add\u00a0subjectAltName\u00a0to v3_req section [ v3_req ] # Extensions to add to a certificate request basicConstraints = CA:FALSE keyUsage = nonRepudiation, digitalSignature, keyEncipherment subjectAltName = @alt_names Add the &#8230; <a title=\"Self-Signed Wildcard certificate with SAN using openssl \/ SSL\" class=\"read-more\" href=\"https:\/\/tech.my-netsol.com\/?p=29\" aria-label=\"Read more about Self-Signed Wildcard certificate with SAN using openssl \/ SSL\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11,4,1],"tags":[15,16,17,18,20],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-linux","category-ssl","category-uncategorized","tag-csr","tag-openssl","tag-san","tag-ssl","tag-wildcard"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tech.my-netsol.com\/index.php?rest_route=\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tech.my-netsol.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.my-netsol.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.my-netsol.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.my-netsol.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":0,"href":"https:\/\/tech.my-netsol.com\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"wp:attachment":[{"href":"https:\/\/tech.my-netsol.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.my-netsol.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.my-netsol.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}