{"id":8220,"date":"2023-11-08T17:13:50","date_gmt":"2023-11-08T09:13:50","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=8220"},"modified":"2023-11-08T17:13:50","modified_gmt":"2023-11-08T09:13:50","slug":"%e5%9b%bd%e5%a4%96%e5%85%8d%e8%b4%b9%e7%9a%84ssl%e8%af%81%e4%b9%a6%e7%94%b3%e8%af%b7%e6%93%8d%e4%bd%9c%e6%b5%81%e7%a8%8b%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/8220\/","title":{"rendered":"\u56fd\u5916\u514d\u8d39\u7684ssl\u8bc1\u4e66\u7533\u8bf7\u64cd\u4f5c\u6d41\u7a0b\u4ecb\u7ecd"},"content":{"rendered":"

SSL\u8bc1\u4e66\u662f\u4e00\u79cd\u6570\u5b57\u8bc1\u4e66\uff0c\u7528\u4e8e\u4fdd\u62a4\u7f51\u7ad9\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u5168\u3002SSL\u8bc1\u4e66\u53ef\u4ee5\u786e\u4fdd\u6570\u636e\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u4e0d\u88ab\u7a83\u53d6\u6216\u7be1\u6539\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0cSSL\u8bc1\u4e66\u9700\u8981\u8d2d\u4e70\u5e76\u4ece\u6743\u5a01\u7684\u8bc1\u4e66\u9881\u53d1\u673a\u6784\uff08CA\uff09\u5904\u83b7\u5f97\u3002\u4f46\u662f\uff0c\u73b0\u5728\u6709\u8bb8\u591a\u514d\u8d39\u7684SSL\u8bc1\u4e66\u53ef\u4f9b\u9009\u62e9\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u56fd\u5916\u514d\u8d39\u7684SSL\u8bc1\u4e66\u7533\u8bf7\u7684\u539f\u7406\u548c\u8fc7\u7a0b\u3002<\/p>\n

\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u4e86\u89e3SSL\u8bc1\u4e66\u7684\u539f\u7406\u3002SSL\u8bc1\u4e66\u91c7\u7528\u516c\u94a5\u52a0\u5bc6\u6280\u672f\uff0c\u901a\u8fc7\u4f7f\u7528\u516c\u94a5\u548c\u79c1\u94a5\u52a0\u5bc6\u548c\u89e3\u5bc6\u6570\u636e\u3002\u5728\u4f7f\u7528SSL\u8bc1\u4e66\u4e4b\u524d\uff0c\u9700\u8981\u751f\u6210\u4e00\u4e2a\u516c\u94a5\u548c\u4e00\u4e2a\u79c1\u94a5\u3002\u516c\u94a5\u4f1a\u88ab\u53d1\u9001\u7ed9\u8bc1\u4e66\u9881\u53d1\u673a\u6784\uff0c\u800c\u79c1\u94a5\u5219\u9700\u8981\u59a5\u5584\u4fdd\u7ba1\u3002\u8bc1\u4e66\u9881\u53d1\u673a\u6784\u5c06\u4f7f\u7528\u60a8\u7684\u516c\u94a5\u6765\u521b\u5efa\u4e00\u4e2a\u6570\u5b57\u8bc1\u4e66\uff0c\u8be5\u6570\u5b57\u8bc1\u4e66\u5305\u542b\u60a8\u7684\u57df\u540d\u548c\u516c\u94a5\u7b49\u4fe1\u606f\u3002\u5f53\u7528\u6237\u8bbf\u95ee\u60a8\u7684\u7f51\u7ad9\u65f6\uff0c\u6d4f\u89c8\u5668\u5c06\u4ece\u8bc1\u4e66\u9881\u53d1\u673a\u6784\u5904\u83b7\u5f97\u60a8\u7684\u6570\u5b57\u8bc1\u4e66\uff0c\u5e76\u4f7f\u7528\u5b83\u6765\u9a8c\u8bc1\u60a8\u7684\u7f51\u7ad9\u7684\u8eab\u4efd\u548c\u5b89\u5168\u6027\u3002<\/p>\n

\u73b0\u5728\uff0c\u6211\u4eec\u6765\u770b\u770b\u5982\u4f55\u7533\u8bf7\u514d\u8d39\u7684SSL\u8bc1\u4e66\u3002\u4ee5\u4e0b\u662f\u4e24\u4e2a\u6700\u6d41\u884c\u7684\u514d\u8d39SSL\u8bc1\u4e66\u63d0\u4f9b\u5546\uff1a<\/p>\n

1. Let’s Encrypt<\/p>\n

Let’s Encrypt\u662f\u4e00\u4e2a\u975e\u8425\u5229\u7ec4\u7ec7\uff0c\u63d0\u4f9b\u514d\u8d39\u7684SSL\u8bc1\u4e66\u3002\u5b83\u7684\u8bc1\u4e66\u662f\u4e0e\u4efb\u4f55\u5176\u4ed6\u5546\u4e1a\u8bc1\u4e66\u76f8\u540c\u7684\u5b89\u5168\u7ea7\u522b\uff0c\u5e76\u7531\u5168\u7403\u5404\u5730\u7684\u6d4f\u89c8\u5668\u4fe1\u4efb\u3002\u4ee5\u4e0b\u662f\u7533\u8bf7Let’s Encrypt\u8bc1\u4e66\u7684\u6b65\u9aa4\uff1a<\/p>\n

\u6b65\u9aa41\uff1a\u5b89\u88c5\u82b1\u751f\u58f3\u514d\u8d39ssl\u7533\u8bf7<\/a>Certbot\u5ba2\u6237\u7aef<\/p>\n

Certbot\u662f\u4e00\u79cd\u81ea\u52a8\u5316\u5de5\u5177\uff0c\u53ef\u5e2e\u52a9\u60a8\u5728\u670d\u52a1\u5668\u4e0a\u8f7b\u677e\u5b89\u88c5Let’s Encrypt\u8bc1\u4e66\u3002Certbot\u652f\u6301\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5305\u62ecLinux\u3001macOS\u548cWindows\u7b49\u3002<\/p>\n

\u6b65\u9aa42\uff1a\u8fd0\u884cCertbot<\/p>\n

\u8fd0\u884cCertbot\u4ee5\u83b7\u5f97\u8bc1\u4e66\u3002\u5728Linux\u4e0a\uff0c\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

sudo certbot certonly –standalone -d example.com<\/p>\n

\u8fd9\u5c06\u542f\u52a8Certbot\u5e76\u4e3a\u60a8\u7684\u57df\u540dexample.com\u751f\u6210\u8bc1\u4e66\u3002<\/p>\n

\u6b65\u9aa43\uff1a\u5b89\u88c5\u8bc1\u4e66<\/p>\n

Certbot\u5c06\u5728\/etc\/letsencrypt\/live\/example.com\u76ee\u5f55\u4e0b\u751f\u6210\u8bc1\u4e66\u6587\u4ef6\u3002\u60a8\u9700\u8981\u5c06\u8fd9\u4e9b\u6587\u4ef6\u590d\u5236\u5230\u60a8\u7684Web\u670d\u52a1\u5668\u4e2d\u3002\u5728Apache\u670d\u52a1\u5668\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

sudo cp \/etc\/letsencrypt\/live\/example.com\/fullchain.pem \/etc\/httpd\/conf\/ssl.crt\/server.crt<\/p>\n

sudo cp \/etc\/letsencrypt\/live\/example.com\/privkey.pem \/etc\/httpd\/conf\/ssl.key\/server.key<\/p>\n

2. Cloudflare<\/p>\n

Cloudflare\u662f\u4e00\u4e2a\u514d\u8d39\u7684CDN\u548c\u5b89\u5168\u670d\u52a1\u63d0\u4f9b\u5546\uff0c\u63d0\u4f9b\u514d\u8d39\u7684SSL\u8bc1\u4e66\u3002\u4ee5\u4e0b\u662f\u7533\u8bf7Cloudflare\u8bc1\u4e66\u7684\u6b65\u9aa4\uff1a<\/p>\n

\u6b65\u9aa41\uff1a\u6ce8\u518cCloudflare\u8d26\u6237<\/p>\n

\u6ce8\u518cCloudflare\u8d26\u6237\uff0c\u5e76\u5c06\u60a8\u7684\u57df\u540d\u6dfb\u52a0\u5230Cloudflare\u4e2d\u3002<\/p>\n

\u6b65\u9aa42\uff1a\u542f\u7528SSL<\/p>\n

\u5728Cloudflare\u4e2d\uff0c\u8f6c\u5230\u201cSSL\/TLS\u201d\u9009\u9879\u5361\uff0c\u5e76\u5c06SSL\u6a21\u5f0f\u8bbe\u7f6e\u4e3a\u201c\u5b8c\u5168\u201d\u3002\u8fd9\u5c06\u542f\u7528\u514d\u8d39\u7684SSL\u8bc1\u4e66\u3002<\/p>\n

\u6b65\u9aa43\uff1a\u4e0b\u8f7d\u8bc1\u4e66<\/p>\n

\u5728Cloudflare\u4e2d\uff0c\u8f6c\u5230\u201cSSL\/TLS\u201d\u9009\u9879\u5361\uff0c\u5e76\u5355\u51fb\u201c\u8bc1\u4e66\u201d\u90e8\u5206\u4e2d\u7684\u201c\u4e0b\u8f7d\u8bc1\u4e66\u201d\u6309\u94ae\u3002\u8fd9\u5c06\u4e0b\u8f7d\u60a8\u7684\u8bc1\u4e66\u548c\u79c1\u94a5\u3002<\/p>\n

\u6b65\u9aa44\uff1a\u5b89\u88c5\u8bc1\u4e66<\/p>\n

\u5c06\u8bc1\u4e66\u548c\u79c1\u94a5\u4e0a\u4f20\u5230\u60a8\u7684Web\u670d\u52a1\u5668\u4e2d\uff0c\u5e76\u5728\u60a8\u7684Web\u670d\u52a1\u5668\u4e0a\u914d\u7f6eSSL\u3002<\/p>\n

\u603b\u7ed3\uff1a<\/p>\n

\u514d\u8d39\u7684SSL\u8bc1\u4e66\u53ef\u4ee5\u5e2e\u52a9\u60a8\u4fdd\u62a4\u60a8\u7684\u7f51\u7ad9\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u5168\u3002Let’s Encrypt\u548cCloudflare\u662f\u4e24\u4e2a\u6700\u53d7\u6b22\u8fce\u7684\u514d\u8d39SSL\u8bc1\u4e66\u63d0\u4f9b\u5546\u3002\u7533\u8bf7\u514d\u8d39\u7684SSL\u8bc1\u4e66\u7684\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6309\u7167\u4e0a\u8ff0\u6b65\u9aa4\u64cd\u4f5c\u5373\u53ef\u3002\u540c\u65f6\uff0c\u514d\u8d39\u7684SSL\u8bc1\u4e66\u4e0e\u4ed8\u8d39\u8bc1\u4e66\u4e00\u6837\u5b89\u5168\uff0c\u56e0\u6b64\u60a8\u53ef\u4ee5\u9009\u62e9\u514d\u8d39\u8bc1\u4e66\u6765\u4fdd\u62a4\u60a8\u7684\u7f51\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

SSL\u8bc1\u4e66\u662f\u4e00\u79cd\u6570\u5b57\u8bc1\u4e66\uff0c\u7528\u4e8e\u4fdd\u62a4\u7f51\u7ad9\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u5168\u3002SSL\u8bc1\u4e66\u53ef\u4ee5\u786e\u4fdd\u6570\u636e\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u4e0d\u88ab\u7a83\u53d6\u6216\u7be1\u6539\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0cSSL\u8bc1\u4e66\u9700\u8981\u8d2d\u4e70\u5e76\u4ece\u6743\u5a01\u7684\u8bc1\u4e66\u9881\u53d1\u673a\u6784\uff08CA\uff09\u5904\u83b7\u5f97\u3002\u4f46\u662f\uff0c\u73b0\u5728\u6709\u8bb8\u591a\u514d\u8d39\u7684S<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[14297,105,14296,797,30],"topic":[],"class_list":{"0":"post-8220","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-sqssl","7":"tag-https","8":"tag-105","10":"tag-797","11":"tag-30"},"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/8220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=8220"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/8220\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=8220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=8220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=8220"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=8220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}