{"id":425,"date":"2015-06-16T16:07:00","date_gmt":"2015-06-16T16:07:00","guid":{"rendered":"https:\/\/www.geekmungus.co.uk\/?p=425"},"modified":"2022-11-05T10:53:19","modified_gmt":"2022-11-05T10:53:19","slug":"create-a-ssl-csr-from-command-line-with-subject-alternate-name","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=425","title":{"rendered":"Create a SSL CSR from Command Line with Subject Alternate Name"},"content":{"rendered":"\n<p>To create a CSR and include not only a CN (Common Name) but also a SAN(s) too, you can use the following process.<\/p>\n\n\n\n<p>1. Firstly create a text file called request.inf and fill it with the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>;----------------- request.inf -----------------\n&#91;Version]\nSignature= $Windows NT$\n&#91;NewRequest]\nSubject = \"CN=host0.oaklands.ac.uk, OU=Department, O=Organisation, L=Town, S=County, C=Country\" ; replace attributes in this line using example below\nKeySpec = 1\nKeyLength = 2048\n; Can be 2048, 4096, 8192, or 16384.\n; Larger key sizes are more secure, but have\n; a greater impact on performance.\nExportable = TRUE\nFriendlyName = vdm\nMachineKeySet = TRUE\nSMIME = False\nPrivateKeyArchive = FALSE\nUserProtected = FALSE\nUseExistingKeySet = FALSE\nProviderName = Microsoft RSA SChannel Cryptographic Provider\nProviderType = 12\nRequestType = PKCS10\nKeyUsage = 0xa0\n&#91;EnhancedKeyUsageExtension]\nOID=1.3.6.1.5.5.7.3.1 ; this is for Server Authentication\n&#91;Extensions]\n2.5.29.17 = \"{text}\"\n_continue_ = \"dns=host1.domain.com&amp;\"\n_continue_ = \"dns=host2.domain.com\"\n;-----------------------------------------------<\/code><\/pre>\n\n\n\n<p>2. Now run this command to create a CSR:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> certreq -new request.inf certreq.txt<\/code><\/pre>\n\n\n\n<p>You can check it has the right info here:<a href=\"https:\/\/certlogik.com\/decoder\/\"> https:\/\/certlogik.com\/decoder\/<\/a> before sending to your CA.<\/p>\n\n\n\n<p>3. Send this CSR to your CA, when you get the file back run the command below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> > certreq -accept cert.cer<\/code><\/pre>\n\n\n\n<p>4. To ensure it has been added correctly, check the Certificate MMC snap-in.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To create a CSR and include not only a CN (Common Name) but also a SAN(s) too, you can use the following process. 1. Firstly create a text file called request.inf and fill it with the following: 2. Now run this command to create a CSR: You can check it has the right info here: &#8230; <a title=\"Create a SSL CSR from Command Line with Subject Alternate Name\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=425\" aria-label=\"Read more about Create a SSL CSR from Command Line with Subject Alternate Name\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-425","post","type-post","status-publish","format-standard","hentry","category-microsoft-windows"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=425"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/425\/revisions"}],"predecessor-version":[{"id":1436,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/425\/revisions\/1436"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}