{"id":133,"date":"2019-07-08T16:34:40","date_gmt":"2019-07-08T16:34:40","guid":{"rendered":"https:\/\/www.ssls.com\/knowledgebase\/?p=133"},"modified":"2022-09-20T14:12:26","modified_gmt":"2022-09-20T14:12:26","slug":"how-to-generate-a-csr-code-on-node-js","status":"publish","type":"post","link":"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/","title":{"rendered":"How to generate a CSR code on Node.js"},"content":{"rendered":"<p><a href=\"https:\/\/www.ssls.com\/knowledgebase\/what-is-csr\/\"><span style=\"font-weight: 400;\">Certificate Signing Request (CSR)<\/span><\/a><span style=\"font-weight: 400;\"> is an encoded text which contains details about the domain a certificate needs to be issued for and your contact details.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The CSR code can be generated on Node.js with the help of the OpenSSL utility. OpenSSL is usually included into the default package and does not require additional installation.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If there is no OpenSSL in the modpack, it can be downloaded with the following commands: <\/span><\/p>\n<p><em><span style=\"font-weight: 400;\">sudo apt-get install openssl<\/span><\/em><span style=\"font-weight: 400;\"> \u00a0or <\/span><\/p>\n<p><em><span style=\"font-weight: 400;\">sudo yum install openssl<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400;\">Alternatively, the OpenSSL utility can be downloaded <\/span><a href=\"https:\/\/www.openssl.org\/\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In order to generate a CSR code and an RSA private key on Node.js, it is necessary to run the following command: <\/span><\/p>\n<p><strong>openssl req -new -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">It is recommended to replace domain.key and domain.csr with the specific names, like the domain names SSL is aimed for, in order to avoid further confusion. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">After having run the command, it is necessary to fill in the following information using <\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Alphanumeric\"><span style=\"font-weight: 400;\">alphanumeric<\/span><\/a><span style=\"font-weight: 400;\"> characters only:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"> &#8211;<\/span><strong> Common name<\/strong><span style=\"font-weight: 400;\">: a <\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Fully_qualified_domain_name\"><span style=\"font-weight: 400;\">fully qualified domain name<\/span><\/a><span style=\"font-weight: 400;\"> the certificate needs to be issued for (ex: yourdomain.com). If the certificate should be issued for a subdomain, specify it as sub.yourdomain.com or <\/span><a href=\"http:\/\/www.yourdomain.com\"><span style=\"font-weight: 400;\">www.yourdomain.com<\/span><\/a><span style=\"font-weight: 400;\"> (where www is actually a subdomain).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For Wildcard certificates, the domain name should be specified with the asterisk (*.yourdomain.com).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8211; <\/span><strong>City<\/strong><span style=\"font-weight: 400;\">: full name of the city the company is located in<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8211; <\/span><strong>State<\/strong><span style=\"font-weight: 400;\">:<\/span> <span style=\"font-weight: 400;\">full name of the state, county or region the company is located in<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8211; <\/span><strong>Country<\/strong><span style=\"font-weight: 400;\">:<\/span> <span style=\"font-weight: 400;\">abbreviated ISO-compliant (<\/span><a href=\"https:\/\/countrycode.org\/\"><span style=\"font-weight: 400;\">two-letter<\/span><\/a><span style=\"font-weight: 400;\">) country code<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8211; <\/span><strong>Organization<\/strong><span style=\"font-weight: 400;\">:<\/span> <span style=\"font-weight: 400;\">official name of the organization applying for the certificate (specify &#8220;NA&#8221; if a certificate is for personal use)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8211; <\/span><strong>Organization Unit<\/strong><span style=\"font-weight: 400;\">:<\/span> <span style=\"font-weight: 400;\">name of the department inside the organization (specify &#8220;NA&#8221; if a certificate is for personal use or there are no departments in the company)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><strong>Email Address <\/strong><span style=\"font-weight: 400;\">and <\/span><strong>Challenge Password<\/strong><span style=\"font-weight: 400;\"> fields are optional and can be left blank. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The CSR code will be created in the domain.csr file. It can be opened with a text editor. The CSR contains the following header and footer:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"> &#8212;&#8211;BEGIN CERTIFICATE REQUEST&#8212;&#8211; and &#8212;&#8211;END CERTIFICATE REQUEST&#8212;&#8211; . <\/span><\/p>\n<p><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Once you have the CSR code, it should be used for the certificate <\/span><a href=\"https:\/\/www.ssls.com\/knowledgebase\/okay-so-i-ordered-an-ssl-how-do-i-get-it-to-work-on-my-domain\/\"><span style=\"font-weight: 400;\">activation<\/span><\/a> <a href=\"https:\/\/www.ssls.com\/knowledgebase\/okay-so-i-ordered-an-ssl-how-do-i-get-it-to-work-on-my-domain\/\"><span style=\"font-weight: 400;\">in your SSLs.com account.<\/span><\/a><span style=\"font-weight: 400;\"> Please include \u00a0the header and footer into the CSR code.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The private key generated along with the CSR code will be created in the domain.key file. It contains the following header and footer: <\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8212;&#8211;BEGIN RSA PRIVATE KEY&#8212;&#8211; and &#8212;&#8211;END RSA PRIVATE KEY&#8212;&#8211; .<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The private key will be necessary for the certificate <a href=\"https:\/\/www.ssls.com\/knowledgebase\/how-to-install-an-ssl-certificate-on-node-js\/\">installation<\/a> on the server after the issuance and thus, we recommend saving it in a separate file on your computer and storing it in a safe place.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Certificate Signing Request (CSR) is an encoded text which contains details about the domain a certificate needs to be issued for and your contact details. The CSR code can be generated on Node.js with the help of the OpenSSL utility. OpenSSL is usually included into the default package and does not require additional installation. If ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-csr-generation-instructions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to generate a CSR code on Node.js \u2013 HelpDesk | SSLs.com<\/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:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to generate a CSR code on Node.js \u2013 HelpDesk | SSLs.com\" \/>\n<meta property=\"og:description\" content=\"Certificate Signing Request (CSR) is an encoded text which contains details about the domain a certificate needs to be issued for and your contact details. The CSR code can be generated on Node.js with the help of the OpenSSL utility. OpenSSL is usually included into the default package and does not require additional installation. If ..Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/\" \/>\n<meta property=\"og:site_name\" content=\"SSL Certificate Knowledgebase | SSLs.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SSLsCom\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-08T16:34:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-20T14:12:26+00:00\" \/>\n<meta name=\"author\" content=\"sslbizdev\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SSLscom\" \/>\n<meta name=\"twitter:site\" content=\"@SSLscom\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sslbizdev\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/\"},\"author\":{\"name\":\"sslbizdev\",\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/#\/schema\/person\/7e29a188929740c7a59d9a1c15c18806\"},\"headline\":\"How to generate a CSR code on Node.js\",\"datePublished\":\"2019-07-08T16:34:40+00:00\",\"dateModified\":\"2022-09-20T14:12:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/\"},\"wordCount\":462,\"publisher\":{\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/#organization\"},\"articleSection\":[\"CSR generation instructions\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/\",\"url\":\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/\",\"name\":\"How to generate a CSR code on Node.js \u2013 HelpDesk | SSLs.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/#website\"},\"datePublished\":\"2019-07-08T16:34:40+00:00\",\"dateModified\":\"2022-09-20T14:12:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ssls.com\/knowledgebase\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to generate a CSR code on Node.js\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/#website\",\"url\":\"https:\/\/www.ssls.com\/knowledgebase\/\",\"name\":\"SSL Certificate Knowledgebase | SSLs.com\",\"description\":\"SSL Knowledgebase | SSLs.com\",\"publisher\":{\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ssls.com\/knowledgebase\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/#organization\",\"name\":\"SSLs.com\",\"url\":\"https:\/\/www.ssls.com\/knowledgebase\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.ssls.com\/knowledgebase\/wp-content\/uploads\/2019\/07\/8WCg7Uph_400x400-1.png\",\"contentUrl\":\"https:\/\/www.ssls.com\/knowledgebase\/wp-content\/uploads\/2019\/07\/8WCg7Uph_400x400-1.png\",\"width\":400,\"height\":400,\"caption\":\"SSLs.com\"},\"image\":{\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SSLsCom\",\"https:\/\/x.com\/SSLscom\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.ssls.com\/knowledgebase\/#\/schema\/person\/7e29a188929740c7a59d9a1c15c18806\",\"name\":\"sslbizdev\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/b43c2e48b8cf4c353e91aa8232dac0c56e490f3f1eff58a7652c7d9a866e3f66?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b43c2e48b8cf4c353e91aa8232dac0c56e490f3f1eff58a7652c7d9a866e3f66?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b43c2e48b8cf4c353e91aa8232dac0c56e490f3f1eff58a7652c7d9a866e3f66?s=96&d=mm&r=g\",\"caption\":\"sslbizdev\"},\"url\":\"https:\/\/www.ssls.com\/knowledgebase\/author\/sslbizdev\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to generate a CSR code on Node.js \u2013 HelpDesk | SSLs.com","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:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/","og_locale":"en_US","og_type":"article","og_title":"How to generate a CSR code on Node.js \u2013 HelpDesk | SSLs.com","og_description":"Certificate Signing Request (CSR) is an encoded text which contains details about the domain a certificate needs to be issued for and your contact details. The CSR code can be generated on Node.js with the help of the OpenSSL utility. OpenSSL is usually included into the default package and does not require additional installation. If ..Read more","og_url":"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/","og_site_name":"SSL Certificate Knowledgebase | SSLs.com","article_publisher":"https:\/\/www.facebook.com\/SSLsCom","article_published_time":"2019-07-08T16:34:40+00:00","article_modified_time":"2022-09-20T14:12:26+00:00","author":"sslbizdev","twitter_card":"summary_large_image","twitter_creator":"@SSLscom","twitter_site":"@SSLscom","twitter_misc":{"Written by":"sslbizdev","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/#article","isPartOf":{"@id":"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/"},"author":{"name":"sslbizdev","@id":"https:\/\/www.ssls.com\/knowledgebase\/#\/schema\/person\/7e29a188929740c7a59d9a1c15c18806"},"headline":"How to generate a CSR code on Node.js","datePublished":"2019-07-08T16:34:40+00:00","dateModified":"2022-09-20T14:12:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/"},"wordCount":462,"publisher":{"@id":"https:\/\/www.ssls.com\/knowledgebase\/#organization"},"articleSection":["CSR generation instructions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/","url":"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/","name":"How to generate a CSR code on Node.js \u2013 HelpDesk | SSLs.com","isPartOf":{"@id":"https:\/\/www.ssls.com\/knowledgebase\/#website"},"datePublished":"2019-07-08T16:34:40+00:00","dateModified":"2022-09-20T14:12:26+00:00","breadcrumb":{"@id":"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ssls.com\/knowledgebase\/how-to-generate-a-csr-code-on-node-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ssls.com\/knowledgebase\/"},{"@type":"ListItem","position":2,"name":"How to generate a CSR code on Node.js"}]},{"@type":"WebSite","@id":"https:\/\/www.ssls.com\/knowledgebase\/#website","url":"https:\/\/www.ssls.com\/knowledgebase\/","name":"SSL Certificate Knowledgebase | SSLs.com","description":"SSL Knowledgebase | SSLs.com","publisher":{"@id":"https:\/\/www.ssls.com\/knowledgebase\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ssls.com\/knowledgebase\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.ssls.com\/knowledgebase\/#organization","name":"SSLs.com","url":"https:\/\/www.ssls.com\/knowledgebase\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ssls.com\/knowledgebase\/#\/schema\/logo\/image\/","url":"https:\/\/www.ssls.com\/knowledgebase\/wp-content\/uploads\/2019\/07\/8WCg7Uph_400x400-1.png","contentUrl":"https:\/\/www.ssls.com\/knowledgebase\/wp-content\/uploads\/2019\/07\/8WCg7Uph_400x400-1.png","width":400,"height":400,"caption":"SSLs.com"},"image":{"@id":"https:\/\/www.ssls.com\/knowledgebase\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SSLsCom","https:\/\/x.com\/SSLscom"]},{"@type":"Person","@id":"https:\/\/www.ssls.com\/knowledgebase\/#\/schema\/person\/7e29a188929740c7a59d9a1c15c18806","name":"sslbizdev","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b43c2e48b8cf4c353e91aa8232dac0c56e490f3f1eff58a7652c7d9a866e3f66?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b43c2e48b8cf4c353e91aa8232dac0c56e490f3f1eff58a7652c7d9a866e3f66?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b43c2e48b8cf4c353e91aa8232dac0c56e490f3f1eff58a7652c7d9a866e3f66?s=96&d=mm&r=g","caption":"sslbizdev"},"url":"https:\/\/www.ssls.com\/knowledgebase\/author\/sslbizdev\/"}]}},"publishpress_future_action":{"enabled":false,"date":"2026-06-02 02:42:13","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category","extraData":[]},"publishpress_future_workflow_manual_trigger":{"enabledWorkflows":[]},"_links":{"self":[{"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":4,"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":6214,"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/133\/revisions\/6214"}],"wp:attachment":[{"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ssls.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}