{"id":1778,"date":"2017-07-13T20:58:43","date_gmt":"2017-07-13T12:58:43","guid":{"rendered":"https:\/\/blog.vimge.com\/?p=1778"},"modified":"2017-08-01T13:49:02","modified_gmt":"2017-08-01T05:49:02","slug":"https-hsts","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/other\/https-hsts.html","title":{"rendered":"\u4f7f\u7528HSTS\u534f\u8bae\u5f3a\u5236\u6d4f\u89c8\u5668\u4f7f\u7528HTTPS\u534f\u8bae\u8bbf\u95ee\u7f51\u7ad9"},"content":{"rendered":"

\u5927\u5bb6\u90fd\u77e5\u9053\u7f51\u7ad9\u542f\u7528SSL\u6570\u5b57\u8bc1\u4e66\u540e\u4f7f\u7528HTTPS\u534f\u8bae\u53ef\u4ee5\u4fdd\u8bc1\u670d\u52a1\u5668\u4e0e\u6d4f\u89c8\u5668\u7aef\u6570\u636e\u52a0\u5bc6\uff0c\u4f46\u4e0e\u6b64\u540c\u65f6\u4e0d\u53ef\u907f\u514d\u53e6\u5916\u4e00\u4e2a\u95ee\u9898\uff0c\u603b\u5b58\u5728\u90e8\u5206\u7528\u6237\u4f1a\u76f4\u63a5\u8f93\u5165\u57df\u540d\u7684\u65b9\u5f0f\u8bbf\u95ee\u7f51\u7ad9\uff0c\u9ed8\u8ba4\u6d4f\u89c8\u5668\u662f\u4f7f\u7528HTTP\u534f\u8bae\u8bbf\u95ee\u7f51\u7ad9\u7684\uff0c\u6b64\u65f6\u5373\u4fbf\u7f51\u7ad9\u542f\u7528\u4e86SSL\u6570\u5b57\u8bc1\u4e66\uff0c\u6b64\u65f6\u7528\u6237\u4e0e\u670d\u52a1\u5668\u7aef\u7684\u6570\u636e\u4ea4\u4e92\u4ecd\u7136\u4f7f\u7528\u7684\u662f\u660e\u6587\u4f20\u8f93\u65b9\u5f0f\uff0c\u7528\u6237\u6570\u636e\u5f97\u4e0d\u5230\u4fdd\u62a4\uff0c\u56e0\u4e3aSSL\u6570\u5b57\u8bc1\u4e66\u6ca1\u6709\u751f\u6548\u3002<\/p>\n

\u53ef\u80fd\u4f60\u4f1a\u8bf4\u90a3\u4e0d\u5982\u76f4\u63a5\u5173\u95ed80\u7aef\u53e3\u5427\uff08\u597d\u5427\uff0c\u5982\u679c\u4f60\u662fAPI\u7b49\u540e\u53f0\u670d\u52a1\u5927\u53ef\u4e0d\u5fc5\u8003\u8651\u524d\u53f0\u7528\u6237\u8bbf\u95ee\u7684\u95ee\u9898\uff09\u6216HTTP\u8bbf\u95ee\u7684\u65f6\u5019\u76f4\u63a5\u8df3\u8f6c\u5230HTTPS\u534f\u8bae\u5427\uff08\u76f4\u63a5\u8df3\u8f6c\u5176\u5b9e\u4e5f\u5b58\u5728\u300e\u4e2d\u95f4\u4eba\u300f\u653b\u51fb\u98ce\u9669\uff09\uff0c\u5176\u5b9e\u8fd9\u4e2a\u95ee\u9898\u6709\u66f4\u597d\u7684\u65b9\u6848\uff0c\u8fd9\u5c31\u662f\u4e0b\u9762\u8981\u4ecb\u7ecd\u7684<\/p>\n

HSTS<\/a>\uff08HTTP Strict Transport Security\uff09\uff0c\u5b83\u662f\u4e00\u4e2aWeb\u5b89\u5168\u7b56\u7565\u673a\u5236\uff08web security policy mechanism\uff09\uff0c\u5b83\u901a\u8fc7\u670d\u52a1\u5668\u4e3aHTTP\u54cd\u5e94\u589e\u52a0\u5982\u4e0b\u4e00\u4e2aHeader \u6765\u8ba9\u6d4f\u89c8\u5668\u5f3a\u5236\u4f7f\u7528HTTPS\u4e0e\u7f51\u7ad9\u8fdb\u884c\u901a\u4fe1\uff0c\u4ee5\u51cf\u5c11\u4f1a\u8bdd\u52ab\u6301\u98ce\u9669\uff1a<\/p>\n

Strict-Transport-Security:max-age=63072000; includeSubdomains; preload<\/p><\/blockquote>\n

\u53ea\u8981\u5728\u670d\u52a1\u5668\u8fd4\u56de\u7ed9\u6d4f\u89c8\u5668\u7684\u54cd\u5e94\u5934\u4e2d\uff0c\u589e\u52a0 Strict-Transport-Security\u8fd9\u4e2aHTTP Header \u6d4f\u89c8\u5668\u90fd\u5c06\u76f4\u63a5\u5f3a\u5236\u6027\u7684\u53d1\u8d77HTTPS\u8bf7\u6c42\uff0c\u73b0\u5728\u8bbf\u95ee\u673a\u5236\u5982\u4e0b<\/p>\n

\"HSTS_1\"<\/p>\n

<\/p>\n

HSTS Header max-age\u53c2\u6570\u4e3a\u6709\u6548\u671f\uff0c\u5728\u6709\u6548\u671f\u5185\uff0c\u6d4f\u89c8\u5668\u53ea\u8981\u5411xxx\u6216\u5176\u5b50\u57df\u540d\u53d1\u9001HTTP\u8bf7\u6c42\u65f6\uff0c\u5fc5\u987b\u91c7\u7528HTTPS\u6765\u53d1\u8d77\u8fde\u63a5\u3002<\/p>\n

\u901a\u5e38\u5982\u679c\u56e0\u4e3a\u8fc7\u671f\u6216\u5176\u4ed6\u539f\u56e0\u5bfc\u81f4SSL\u8bc1\u4e66\u5931\u6548\u7684\u65f6\u5019\uff0c\u6d4f\u89c8\u5668\u4f1a\u63d0\u793a\u6211\u4eec\u8bc1\u4e66\u5931\u6548\u5e76\u63d0\u793a\u98ce\u9669\uff0c\u4f46\u6211\u4eec\u4ecd\u7136\u80fd\u591f\u8bbf\u95ee\u7f51\u7ad9\uff0c\u5982\u679c\u4f7f\u7528\u4e86HSTS\u540e\u5219\u670d\u52a1\u5668\u5c06\u4e25\u683c\u7981\u6b62\u7ee7\u7eed\u8bbf\u95ee\uff0c\u63d0\u793a\u5982\u4e0b<\/p>\n

\"HSTS_2\"<\/p>\n

\u4e0d\u8db3\u548c\u7f3a\u9677<\/strong><\/p>\n

\u81f3\u6b64\uff0c\u4f60\u53ef\u80fd\u4f1a\u53d1\u73b0\uff0cHSTS\u534f\u8bae\u5176\u4ed6\u8fd8\u662f\u6709\u4ed6\u7684\u7f3a\u9677\uff0c\u5373\u7528\u6237\u9996\u6b21\u8bbf\u95ee\u7684\u65f6\u5019\u4f9d\u7136\u8981\u501f\u52a9HTTP\u534f\u8bae\u8fd4\u56deHSTS Header\uff0c\u8fd9\u5c06\u4f9d\u7136\u4f1a\u4ea7\u751f\u4e00\u6b21\u4e2d\u95f4\u4eba\u653b\u51fb\u98ce\u9669\u3002<\/p>\n

Preload List<\/strong><\/p>\n

\u9488\u5bf9\u4e0a\u9762\u7684\u653b\u51fb\uff0cHSTS\u4e5f\u6709\u5e94\u5bf9\u529e\u6cd5\uff0c\u90a3\u5c31\u662f\u5728\u6d4f\u89c8\u5668\u91cc\u5185\u7f6e\u4e00\u4e2a\u5217\u8868\uff0c\u53ea\u8981\u662f\u5728\u8fd9\u4e2a\u5217\u8868\u91cc\u7684\u57df\u540d\uff0c\u65e0\u8bba\u4f55\u65f6\u3001\u4f55\u79cd\u60c5\u51b5\uff0c\u6d4f\u89c8\u5668\u90fd\u53ea\u4f7f\u7528HTTPS\u53d1\u8d77\u8fde\u63a5\u3002\u8fd9\u4e2a\u5217\u8868\u7531Google Chromium\u7ef4\u62a4\uff0cFireFox\u3001Safari\u3001IE\u7b49\u4e3b\u6d41\u6d4f\u89c8\u5668\u5747\u5728\u4f7f\u7528\u3002<\/p>\n

\u53ef\u4ee5\u5728HSTS Preload List\u7684\u5b98\u7f51\u4e0a\uff08https:\/\/hstspreload.org\uff09\u63d0\u4ea4\u7533\u8bf7\uff0c\u6216\u8005\u4e86\u89e3\u66f4\u591a\u8be6\u7ec6\u7684\u5185\u5bb9\u3002<\/p>\n

 <\/p>\n


\n

2017-8-1 \u66f4\u65b0<\/p>\n

\u767e\u5ea6\u8fd1\u671f\u63a8\u51fa\u4e86HTTPS\u8ba4\u8bc1\uff0c\u5728\u767e\u5ea6\u7ad9\u957f\u5de5\u5177\u91cc\u9762\u8ba4\u8bc1\u901a\u8fc7\u540e\u7f51\u7ad9\u6536\u5f55\u81ea\u52a8\u66ff\u6362\u4e3aHTTPS\u534f\u8bae\uff0c\u7ed3\u5408HSTS\u8fdb\u4e00\u6b65\u964d\u4f4e\u4e86\u5165\u53e3\u98ce\u9669\uff0c\u6bd5\u7adf\u5f88\u591a\u7528\u6237\u6d41\u91cf\u90fd\u6765\u81ea\u767e\u5ea6<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5927\u5bb6\u90fd\u77e5\u9053\u7f51\u7ad9\u542f\u7528SSL\u6570\u5b57\u8bc1\u4e66\u540e\u4f7f\u7528HTTPS\u534f\u8bae\u53ef\u4ee5\u4fdd\u8bc1\u670d\u52a1\u5668\u4e0e\u6d4f\u89c8\u5668\u7aef\u6570\u636e\u52a0\u5bc6\uff0c\u4f46\u4e0e\u6b64\u540c\u65f6\u4e0d\u53ef\u907f\u514d\u53e6\u5916\u4e00 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,5],"tags":[160,159,144],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1778"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1778"}],"version-history":[{"count":8,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1778\/revisions"}],"predecessor-version":[{"id":1790,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1778\/revisions\/1790"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}