{"id":134,"date":"2011-04-28T22:35:37","date_gmt":"2011-04-28T14:35:37","guid":{"rendered":"http:\/\/blog.nami.idv.tw\/?p=134"},"modified":"2011-06-20T13:28:26","modified_gmt":"2011-06-20T05:28:26","slug":"%e4%bd%bf%e7%94%a8-openssl-%e5%bb%ba%e7%ab%8b%e8%87%aa%e6%88%91%e7%b0%bd%e7%ab%a0%e7%b5%a6-iis-%e7%94%a8","status":"publish","type":"post","link":"https:\/\/blog.nami.idv.tw\/?p=134","title":{"rendered":"\u4f7f\u7528 OpenSSL \u5efa\u7acb\u81ea\u6211\u7c3d\u7ae0\u7d66 IIS \u7528"},"content":{"rendered":"<p>\u53c3\u8003\u81ea\uff1ahttp:\/\/www.l-penguin.idv.tw\/article\/iis-ssl.htm<\/p>\n<p>domain name \u7684\u90e8\u5206\u4ee5 [DOMAIN_NAME] \u53d6\u4ee3\u800c\u5df2\uff0c\u4f7f\u7528 openssl 1.0.0d \u7248\u3002<\/p>\n<p><strong>\u5efa\u7acb\u5c08\u6709\u6191\u8b49\u4e2d\u5fc3\u7684\u79c1\u6709\u91d1\u9470<\/strong><\/p>\n<pre lang=\"text\">root # openssl genrsa -des3 -out ca.[DOMAIN_NAME].key 1024\r\n\r\nGenerating RSA private key, 1024 bit long modulus\r\n............................................++++++\r\n.............++++++\r\ne is 65537 (0x10001)\r\nEnter pass phrase for ca.[DOMAIN_NAME].key: your_password\r\nVerifying - Enter pass phrase for ca.[DOMAIN_NAME].key: your_password<\/pre>\n<p><strong>\u5efa\u7acb\u6191\u8b49\u4e2d\u5fc3\u7684\u7c3d\u8b49\u6a94<\/strong><\/p>\n<pre lang=\"text\">root # openssl req -new -key ca.[DOMAIN_NAME].key -x509 -days 1095 -out ca.[DOMAIN_NAME].crt\r\n\r\nEnter pass phrase for ca.[DOMAIN_NAME].key: your_passowrd\r\nYou are about to be asked to enter information that will be incorporated\r\ninto your certificate request.\r\nWhat you are about to enter is what is called a Distinguished Name or a DN.\r\nThere are quite a few fields but you can leave some blank\r\nFor some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nCountry Name (2 letter code) [GB]:TW\r\nState or Province Name (full name) [Berkshire]:Taipei\r\nLocality Name (eg, city) [Newbury]:Taipei\r\nOrganization Name (eg, company) [My Company Ltd]: [YOUR CORP].\r\nOrganizational Unit Name (eg, section) []:CA\r\nCommon Name (eg, your name or your server's hostname) []:ca.[DOMAIN_NAME]\r\nEmail Address []:webmaster@[DOMAIN_NAME]<\/pre>\n<p>\u70ba IIS \u7db2\u7ad9 www.[DOMAIN_NAME] \u8a2d\u5b9a\u4e00\u500b SSL \u9023\u7dda\u3002<br \/>\n\u5728 IIS \u7db2\u7ad9\u5167\u5bb9\u88e1\uff0c\u9078\u64c7\u76ee\u9304\u5b89\u5168\u8a2d\u5b9a\u9801\u7c64\uff0c\u9ede\u9078\u4f3a\u670d\u5668\u6191\u8b49\u3002<br \/>\n\u8acb\u4f9d\u4e0b\u9806\u5e8f\u5efa\u7acb\u4e00\u500b www.[DOMAIN_NAME] \u7684\u79c1\u6709\u91d1\u9470\u3002<\/p>\n<ol>\n<li>\u5efa\u7acb\u65b0\u6191\u8b49\u3002<\/li>\n<li>\u6e96\u5099\u8981\u6c42\uff0c\u4f46\u7a0d\u5019\u50b3\u9001\u3002<\/li>\n<li>\u5728\u540d\u7a31\u8f38\u5165 www.[DOMAIN_NAME]\u3002<\/li>\n<li>\u8f38\u5165\u8a72\u670d\u52d9\u7684\u55ae\u4f4d\u5730\u7406\u8cc7\u8a0a\u3002<\/li>\n<li>\u5728\u516c\u7528\u540d\u7a31\u8f38\u5165 www.[DOMAIN_NAME]\u3002<\/li>\n<li>\u8a2d\u5b9a\u79c1\u6709\u91d1\u9470\u7684\u8f38\u51fa\u4f4d\u7f6e\u53ca\u6a94\u540d\uff0c\u672c\u4f8b\u70ba www.[DOMAIN_NAME].csr\u3002<\/li>\n<li>\u8a2d\u5b9a\u79c1\u9470\u4e4b\u5f8c\uff0c\u8acb\u628a\u5b83\u4e0b\u8f09\u56de\u4f86\u3002<\/li>\n<\/ol>\n<p><strong>\u4f7f\u7528 ca.[DOMAIN_NAME] \u53bb\u505a www.[DOMAIN_NAME] \u7684\u7c3d\u8b49<\/strong><\/p>\n<pre lang=\"text\">root # openssl x509 -req -days 365 -in web.[DOMAIN_NAME].csr -CA ca.[DOMAIN_NAME].crt -CAkey ca.[DOMAIN_NAME].key -CAcreateserial -out web.[DOMAIN_NAME].crt\r\n\r\nSignature ok\r\nsubject=\/CN=web.[DOMAIN_NAME]\/OU=Web\/O=l-penguin Corp.\/L=Taipei\/ST=Taiwan\/C=TW\r\nGetting CA Private Key\r\nEnter pass phrase for ca.[DOMAIN_NAME].key:your_password<\/pre>\n<ol>\n<li>\u8655\u7406\u64f1\u7f6e\u8981\u6c42\u53ca\u5b89\u88dd\u6191\u8b49\u3002<\/li>\n<li>\u9078\u64c7\u5df2\u7c3d\u8b49\u904e\u7684 crt\u3002<\/li>\n<li>\u78ba\u8a8d\u4f60\u7684\u6191\u8b49\u8cc7\u8a0a\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u53c3\u8003\u81ea\uff1ahttp:\/\/www.l-penguin.idv.tw\/article\/ &hellip; <a href=\"https:\/\/blog.nami.idv.tw\/?p=134\">\u95b1\u8b80\u5168\u6587 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[7],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-web-technology","tag-iis"],"_links":{"self":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=134"}],"version-history":[{"count":8,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions"}],"predecessor-version":[{"id":171,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions\/171"}],"wp:attachment":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}