{"id":199231,"date":"2020-09-05T08:49:23","date_gmt":"2020-09-05T00:49:23","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=199231"},"modified":"2020-08-25T09:51:02","modified_gmt":"2020-08-25T01:51:02","slug":"ca-https-proxy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/ca-https-proxy.html","title":{"rendered":"\u5982\u4f55\u4f7f\u7528\u81ea\u7b7eCA\u914d\u7f6eHTTPS\u52a0\u5bc6\u53cd\u5411\u4ee3\u7406\u8bbf\u95ee\uff1f"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u968f\u7740\u4e92\u8054\u7f51\u7684\u53d1\u5c55\uff0c\u5f88\u591a\u516c\u53f8\u548c\u4e2a\u4eba\u8d8a\u6765\u8d8a\u91cd\u89c6\u7f51\u7edc\u7684\u5b89\u5168\u6027\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u516c\u53f8\u91c7\u7528HTTPS\u534f\u8bae\u6765\u4ee3\u66ff\u4e86HTTP\u534f\u8bae\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n \u4f5c\u8005\u4e2a\u4eba\u7814\u53d1\u7684\u5728\u9ad8\u5e76\u53d1\u573a\u666f\u4e0b\uff0c\u63d0\u4f9b\u7684\u7b80\u5355\u3001\u7a33\u5b9a\u3001\u53ef\u6269\u5c55\u7684\u5ef6\u8fdf\u6d88\u606f\u961f\u5217\u6846\u67b6\uff0c\u5177\u6709\u7cbe\u51c6\u7684\u5b9a\u65f6\u4efb\u52a1\u548c\u5ef6\u8fdf\u961f\u5217\u5904\u7406\u529f\u80fd\u3002\u81ea\u5f00\u6e90\u534a\u5e74\u591a\u4ee5\u6765\uff0c\u5df2\u6210\u529f\u4e3a\u5341\u51e0\u5bb6\u4e2d\u5c0f\u578b\u4f01\u4e1a\u63d0\u4f9b\u4e86\u7cbe\u51c6\u5b9a\u65f6\u8c03\u5ea6\u65b9\u6848\uff0c\u7ecf\u53d7\u4f4f\u4e86\u751f\u4ea7\u73af\u5883\u7684\u8003\u9a8c\u3002\u4e3a\u4f7f\u66f4\u591a\u7ae5\u978b\u53d7\u76ca\uff0c\u73b0\u7ed9\u51fa\u5f00\u6e90\u6846\u67b6\u5730\u5740\uff1ahttps:\/\/github.com\/sunshinelyz\/mykit-delay<\/p>\n \u5199\u5728\u524d\u9762<\/strong><\/div>\n \u968f\u7740\u4e92\u8054\u7f51\u7684\u53d1\u5c55\uff0c\u5f88\u591a\u516c\u53f8\u548c\u4e2a\u4eba\u8d8a\u6765\u8d8a\u91cd\u89c6\u7f51\u7edc\u7684\u5b89\u5168\u6027\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u516c\u53f8\u91c7\u7528HTTPS\u534f\u8bae\u6765\u4ee3\u66ff\u4e86HTTP\u534f\u8bae\u3002\u4e3a\u4f55\u8bf4HTTPS\u534f\u8bae\u6bd4HTTP\u534f\u8bae\u5b89\u5168\u5462?\u5c0f\u4f19\u4f34\u4eec\u81ea\u884c\u767e\u5ea6\u5427!\u6211\u5c31\u4e0d\u8bf4\u4e86\u3002\u4eca\u5929\uff0c\u6211\u4eec\u5c31\u4e00\u8d77\u6765\u804a\u804a\u5982\u4f55\u4f7f\u7528\u81ea\u7b7eCA\u914d\u7f6eNginx\u7684HTTPS\u52a0\u5bc6\u53cd\u5411\u4ee3\u7406\u3002\u54b3\u54b3\uff0c\u5c0f\u4f19\u4f34\u4eec\u5feb\u4e0a\u8f66\u3002<\/p>\n \u5982\u679c\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff0c\u8bf7\u6587\u672b\u7559\u8a00\uff0c\u70b9\u4e2a\u8d5e\uff0c\u7ed9\u4e2a\u5728\u770b\u548c\u8f6c\u53d1\uff0c\u5927\u5bb6\u7684\u652f\u6301\u662f\u6211\u6301\u7eed\u521b\u4f5c\u7684\u6700\u5927\u52a8\u529b!<\/p>\n Nginx\u5b9e\u73b0HTTPS<\/strong><\/div>\n \u51fa\u4e8e\u5b89\u5168\u8bbf\u95ee\u8003\u8651\uff0c\u91c7\u7528\u7684CA\u662f\u672c\u673aOpenssl\u81ea\u7b7e\u540d\u751f\u6210\u7684\uff0c\u56e0\u6b64\u65e0\u6cd5\u901a\u8fc7\u4e92\u8054\u7f51\u5de5\u4fe1Root CA\u9a8c\u8bc1\uff0c\u6240\u4ee5\u4f1a\u51fa\u73b0\u8be5\u7f51\u7ad9\u4e0d\u53d7\u4fe1\u4efb\u6216\u5b89\u5168\u8bc1\u4e66\u65e0\u6548\u7684\u63d0\u793a\uff0c\u76f4\u63a5\u8df3\u8fc7\uff0c\u76f4\u63a5\u8bbf\u95ee\u5373\u53ef!<\/p>\n HTTPS\u7684\u539f\u7406\u548c\u8bbf\u95ee\u8fc7\u7a0b<\/strong><\/div>\n \u670d\u52a1\u5668\u5fc5\u8981\u6761\u4ef6\u6709\u4e24\u4e2a\uff1a\u4e00\u4e2a\u670d\u52a1\u5668\u79c1\u94a5 KEY\u6587\u4ef6\uff0c\u4e00\u5f20\u4e0e\u670d\u52a1\u5668\u57df\u540d\u5339\u914d\u7684CA\u8bc1\u4e66(\u516c\u94a5\uff0c\u6839\u636e\u79c1\u94a5key\u751f\u6210)<\/p>\n \u8bbf\u95ee\u8fc7\u7a0b<\/strong><\/div>\n (1)\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u901a\u8fc7https\u534f\u8bae\u8bbf\u95ee\u670d\u52a1\u5668\u7684443\u7aef\u53e3\uff0c\u5e76\u83b7\u5f97\u670d\u52a1\u5668\u7684\u8bc1\u4e66(\u516c\u94a5);\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8fd9\u65f6\u5019\u4f1a\u53bb\u627e\u4e00\u4e9b\u4e92\u8054\u7f51\u53ef\u4fe1\u7684RootCA(\u6743\u5a01\u8bc1\u4e66\u9881\u53d1\u673a\u6784)\u9a8c\u8bc1\u5f53\u524d\u83b7\u53d6\u5230\u7684\u8bc1\u4e66\u662f\u5426\u5408\u6cd5\u6709\u6548\uff0cPS\uff1a\u8fd9\u4e9bRootCA\u662f\u968f\u64cd\u4f5c\u7cfb\u7edf\u4e00\u8d77\u9884\u8bbe\u5b89\u88c5\u5728\u4e86\u7cfb\u7edf\u91cc\u9762\u7684;<\/p>\n (2)\u5982\u679cRootCA\u9a8c\u8bc1\u901a\u8fc7\uff0c\u8868\u793a\u8be5\u8bc1\u4e66\u662f\u53ef\u4fe1\u7684\uff0c\u5e76\u4e14\u82e5\u8bc1\u4e66\u4e2d\u6807\u6ce8\u7684\u670d\u52a1\u5668\u540d\u79f0\u4e0e\u5f53\u524d\u8bbf\u95ee\u7684\u670d\u52a1\u5668URL\u5730\u5740\u4e00\u81f4\uff0c\u5c31\u4f1a\u76f4\u63a5\u4f7f\u7528\u8be5\u8bc1\u4e66\u4e2d\u5305\u542b\u7684\u516c\u94a5\u89e3\u5bc6\u670d\u52a1\u5668\u901a\u8fc7\u81ea\u5df1\u7684KEY(\u79c1\u94a5)\u52a0\u5bc6\u540e\u4f20\u8f93\u8fc7\u6765\u7684\u7f51\u9875\u5185\u5bb9\uff0c\u4ece\u800c\u6b63\u5e38\u663e\u793a\u9875\u9762\u5185\u5bb9;<\/p>\n (3)\u5982\u679cRootCA\u9a8c\u8bc1\u4e0d\u901a\u8fc7\uff0c\u8bf4\u660e\u8be5\u8bc1\u4e66\u662f\u672a\u83b7\u5f97\u5408\u6cd5\u7684RootCA\u7b7e\u540d\u548c\u6388\u6743\uff0c\u56e0\u6b64\u4e5f\u5c31\u65e0\u6cd5\u8bc1\u660e\u5f53\u524d\u6240\u8bbf\u95ee\u7684\u670d\u52a1\u5668\u7684\u6743\u5a01\u6027\uff0c\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8fd9\u65f6\u5019\u5c31\u4f1a\u663e\u793a\u4e00\u4e2a\u8b66\u544a\uff0c\u63d0\u793a\u7528\u6237\u5f53\u524d\u8bbf\u95ee\u7684\u670d\u52a1\u5668\u8eab\u4efd\u65e0\u6cd5\u5f97\u5230\u9a8c\u8bc1\uff0c\u8be2\u95ee\u7528\u6237\u662f\u5426\u7ee7\u7eed\u6d4f\u89c8!(\u901a\u5e38\u81ea\u7b7e\u540d\u7684CA\u8bc1\u4e66\u5c31\u662f\u8fd9\u79cd\u60c5\u51b5)<\/p>\n <\/p>\n \u8fd9\u91cc\u9700\u8981\u6ce8\u610f\uff0c\u9a8c\u8bc1CA\u7684\u6709\u6548\u6027\uff0c\u53ea\u662f\u8bc1\u660e\u5f53\u524d\u670d\u52a1\u5668\u7684\u8eab\u4efd\u662f\u5426\u5408\u6cd5\u6709\u6548\uff0c\u662f\u5426\u5177\u6709\u516c\u4fe1\u529b\u4ee5\u53ca\u8eab\u4efd\u552f\u4e00\u6027\uff0c\u9632\u6b62\u5176\u4ed6\u4eba\u4eff\u5192\u8be5\u7f51\u7ad9;\u4f46\u5e76\u4e0d\u4f1a\u5f71\u54cd\u5230\u7f51\u9875\u7684\u52a0\u5bc6\u529f\u80fd\uff0c\u5c3d\u7ba1CA\u8bc1\u4e66\u65e0\u6cd5\u5f97\u5230\u6743\u5a01\u8bc1\u660e\uff0c\u4f46\u662f\u5b83\u6240\u5305\u542b\u7684\u516c\u94a5\u548c\u670d\u52a1\u5668\u4e0a\u7528\u4e8e\u52a0\u5bc6\u9875\u9762\u7684\u79c1\u94a5\u4f9d\u7136\u662f\u5339\u914d\u7684\u4e00\u5bf9\uff0c\u6240\u4ee5\u670d\u52a1\u5668\u7528\u81ea\u5df1\u7684\u79c1\u94a5\u52a0\u5bc6\u7684\u7f51\u9875\u5185\u5bb9\uff0c\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u4f9d\u7136\u662f\u53ef\u4ee5\u7528\u8fd9\u5f20\u8bc1\u4e66\u6765\u89e3\u5bc6\uff0c\u6b63\u5e38\u663e\u793a\u7f51\u9875\u5185\u5bb9\uff0c\u6240\u4ee5\u5f53\u7528\u6237\u70b9\u51fb\u201c\u7ee7\u7eed\u6d4f\u89c8\u6b64\u7f51\u7ad9(\u4e0d\u63a8\u8350)\u201d\u65f6\uff0c\u7f51\u9875\u5c31\u53ef\u4ee5\u6253\u5f00\u4e86;<\/p>\n \u81ea\u7b7e\u540dCA\u8bc1\u4e66\u751f\u6210<\/strong><\/div>\n 1.\u7528Openssl\u968f\u673a\u751f\u6210\u670d\u52a1\u5668\u5bc6\u94a5\uff0c\u548c\u8bc1\u4e66\u7533\u8bf7\u6587\u4ef6CSR<\/strong><\/span><\/div>\n <\/p>\n 2.\u81ea\u5df1\u7ed9\u81ea\u5df1\u7b7e\u53d1\u8bc1\u4e66<\/strong><\/span><\/div>\n \u5728\u670d\u52a1\u5668\u547d\u4ee4\u884c\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\u529e\u6cd5\u8bc1\u4e66\u3002<\/p>\n \r\n#opensslx509 -req -days 3650 -in moonfly.net.csr -signkeymoonfly.net.key -outmoonfly.net.crt \r\n<\/pre>\n |