{"id":100751,"date":"2024-07-27T06:57:12","date_gmt":"2024-07-26T22:57:12","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=100751"},"modified":"2024-07-27T06:57:12","modified_gmt":"2024-07-26T22:57:12","slug":"redhat7-curl-https","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/redhat7-curl-https.html","title":{"rendered":"RedHat7.2\u81ea\u5e26curl\u8bf7\u6c42https\u7ad9\u70b9\u62a5\u9519\u89e3\u51b3\u65b9\u6848"},"content":{"rendered":"

\"\"<\/p>\n

\u95ee\u9898\u80cc\u666f<\/strong><\/div>\n

\u6211\u4eec\u7684\u9879\u76ee\u8981\u62ff\u5230\u5ba2\u6237\u673a\u4e0a\u505a\u79c1\u6709\u5316\u5b89\u88c5\uff0c\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\u5ba2\u6237\u6307\u5b9a\u53ea\u80fd\u4f7f\u7528redhat7.2\u7248\u672c\uff0c\u4e14\u5ba2\u6237\u673a\u4e3a\u4e86\u4fdd\u5bc6\u9700\u8981\u4e0d\u80fd\u8bbf\u95ee\u5916\u7f51\uff0c\u800c\u64cd\u86cb\u7684redhat\u7cfb\u7edf\u81ea\u5e26\u7684curl\u652f\u6301\u7684\u662fnss\u534f\u8bae\u7684https\uff0c\u800c\u975eopenssl\u534f\u8bae\u7684https\uff0c\u6267\u884ccurl\u8bbf\u95eehttps\u7ad9\u70b9\u7684\u65f6\u5019\u4f1a\u51fa\u73b0\u65e0\u6cd5load key\u7684\u62a5\u9519\u3002<\/p>\n

\u7f51\u4e0a\u67e5\u4e86\u4e00\u4e0b\u89e3\u51b3\u65b9\u6848\uff0cStack Overflow\u4e0a\u6709\u7b54\u6848\u8bf4\u662f\u751f\u6210\u7684key\u7684\u95ee\u9898\uff0c\u9700\u8981\u5c06key\u8f6c\u6362\u6210RSA\u7684\u52a0\u5bc6\u65b9\u5f0f\uff0c\u6211\u8bd5\u4e86\u4e00\u4e0b\uff0ccurl\u547d\u4ee4\u4e0d\u4f1a\u62a5\u9519\uff0c\u4f46\u6211\u4eec\u7684\u670d\u52a1\u7aef\u4ee3\u7801\u5b9e\u73b0\u4e0d\u80fd\u6b63\u5e38\u7684\u521d\u59cb\u5316\u76f8\u5173\u52a0\u89e3\u5bc6\u5bb9\u5668\u3002<\/p>\n

\u8fd8\u6709\u90e8\u5206\u7b54\u6848\u63a8\u8350\u91cd\u88c5curl\uff0c\u7531\u4e8e\u5bf9redhat\u7cfb\u7edf\u5e76\u4e0d\u719f\u6089\uff0c\u4e14\u5411\u6765\u542c\u8bf4linux\u4e0a\u79bb\u7ebf\u5b89\u88c5\u7684\u65f6\u5019\u9700\u8981\u5904\u7406\u7684\u4f9d\u8d56\u6bd4\u8f83\u590d\u6742\uff0c\u6211\u7684\u5185\u5fc3\u5176\u5b9e\u662f\u62d2\u7edd\u7684\uff0c\u4f46\u6ca1\u6709\u66f4\u597d\u7684\u89e3\u51b3\u529e\u6cd5\uff0c\u53ea\u80fd\u786c\u7740\u5934\u76ae\u4e0a\u4e86\u3002\u3002\u3002<\/p>\n

\u5b89\u88c5zlib<\/strong><\/div>\n

\u8bbf\u95eezlib\u5b98\u7f51\uff0c\u4e0b\u8f7d\u6700\u65b0\u7684zlib\u5305\uff0c\u8fd9\u91cc\u7531\u4e8e\u6211\u7684rhel\u662f\u8f83\u65b0\u76847.2\u7248\u672c\uff0c\u56e0\u6b64\u76f4\u63a5\u4f7f\u7528\u4e86zlib\u7684\u6700\u65b0\u7248\uff0c\u5982\u679c\u662f\u8001\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u8003\u8651linux\u5185\u6838\u7684\u517c\u5bb9\u6027\u95ee\u9898\uff1b<\/p>\n

\u89e3\u538b\u7f29zlib\u5b89\u88c5\u5305\uff0ccd\u5230\u89e3\u538b\u7f29\u7684zlib\u5305\u76ee\u5f55\u4e0b\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4:<\/p>\n

\r\n.\/configure\r\nmake test\r\nmake install #\u8fd9\u91cc\u5b89\u88c5\u7684\u662f\u9759\u6001\u5e93\r\nmake clean\r\n.\/configure --shared\r\nmake test\r\nmake install #\u8fd9\u91cc\u5148clean\uff0c\u7136\u540e\u5b89\u88c5\u7684\u662f\u5171\u4eab\u5e93\r\ncp zutil.h \/usr\/local\/include\r\ncp zutil.c \/usr\/local\/include #\u62f7\u8d1d\u76f8\u5173\u6587\u4ef6\r\n<\/pre>\n

\u7531\u4e8e\u5728\u6b65\u9aa42\u4e2d\u6ca1\u6709\u663e\u793a\u7684\u6307\u5b9azlib\u7684\u5b89\u88c5\u76ee\u5f55\uff0c\u56e0\u6b64zlib\u9ed8\u8ba4\u88ab\u5b89\u88c5\u5230\u4e86\/usr\/local\/lib\u4e0b\uff0c\u5c06 \/usr\/local\/lib \u6dfb\u52a0\u5230 \/etc\/ld.so.conf \u6587\u4ef6\u4e2d\uff0c\u5e76\u5728\/etc\u4e0b\u6267\u884cldconfig\uff0c\u4f7f\u914d\u7f6e\u751f\u6548\uff0czlib\u5b89\u88c5\u5b8c\u6bd5<\/p>\n

\u5b89\u88c5openssl<\/strong><\/div>\n

\u8bbf\u95eeopenssl\u5b98\u7f51\uff0c\u4e0b\u8f7d\u6700\u65b0\u7684openssl\u5305\uff1b<\/p>\n

\u89e3\u538b\u7f29openssl\u5b89\u88c5\u5305\uff0ccd\u5230\u89e3\u538b\u7f29\u7684\u76ee\u5f55\u4e0b\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4:<\/p>\n

\r\n.\/config --prefix=\/usr\/local\/ssl shared zlib-dynamic #\u6307\u5b9aopenssl\u7684\u5b89\u88c5\u76ee\u5f55\uff0c\u521b\u5efa\u52a8\u6001\u5e93\uff0c\u5e76\u5728\u9700\u8981\u7684\u65f6\u5019\u52a8\u6001\u5f15\u7528zlib\u6587\u4ef6(\u611f\u89c9\u6211\u7406\u89e3\u5f88\u80a4\u6d45\u4e14\u6709\u95ee\u9898\uff0c\u5e0c\u671b\u53ef\u4ee5\u6709\u5927\u795e\u7ed9\u900f\u5f7b\u7684\u89e3\u7b54\u4e0b\u8fd9\u6761\u547d\u4ee4\u7684\u5177\u4f53\u542b\u4e49)\r\n.\/config -t #\u597d\u50cf\u6ca1\u4ec0\u4e48\u5375\u7528\uff0c\u5c31\u662f\u8f93\u51fa\u4e0b\u64cd\u4f5c\u7cfb\u7edf\u7684\u76f8\u5173\u4fe1\u606f\r\nmake #\u6211\u6267\u884c\u8fd9\u53e5\u7684\u65f6\u5019\u62a5\u9519\u4e86\uff0c\u5927\u610f\u5c31\u662f\u627e\u4e0d\u5230\u76f8\u5173\u7684\u52a8\u6001\u5e93\uff0c\u7f51\u4e0a\u641c\u4e86\u4e00\u5708\u6ca1\u6709\u627e\u5230\u4ec0\u4e48\u5408\u9002\u7684\u7b54\u6848\uff0c\u9083\u81ea\u5df1\u4fee\u6539\u4e86\u4e0bMakefile\uff0c\u5728gcc\u7684\u6307\u5b9a\u4e2d\u6dfb\u52a0\u4e86-fPIC\u9009\u9879\uff0c\u6ce8\u610f\uff0c\u7531\u4e8emake\u4e86\u4e00\u534a\u62a5\u9519\uff0c\u6240\u4ee5\u9700\u8981\u5148\u6267\u884c **make clean** \u7136\u540e\u518d\u91cd\u65b0make\uff0c\u5982\u679c\u4e00\u4e0a\u6765\u5c31\u4fee\u6539\u4e86Makefile\uff0c\u53ef\u4ee5\u4e0d\u7528\u6267\u884c **make clean** \r\nmake test #\u6267\u884c\u8fd9\u53e5\u7684\u65f6\u5019\u6211\u8fd9\u8fb9\u4e5f\u62a5\u9519\u4e86\uff0c\u610f\u601d\u662fConditional.pm\u8fd9\u4e2a\u6a21\u5757\u627e\u4e0d\u5230\uff0c\u5728\u7f51\u4e0a\u641c\u4e86\u4e00\u5708\uff0c\u7adf\u7136\u627e\u4e0d\u5230\u5408\u9002\u7684\u7b54\u6848\uff0c\u6211\u53ea\u60f3\u8bf4\u6211\u5bf9redhat\u771f\u7684\u662f\u65e0\u529b\u5410\u69fd\u4e86\uff0c\u7f3a\u7684\u4e1c\u897f\u4e5f\u592a\u591a\u4e86\uff0c\u5c31\u8fd9\u8fd8\u80fd\u6323\u94b1\uff0c\u4e0d\u8fc7\u8bf4\u4e0d\u5b9a\u4e5f\u5c31\u662f\u9760\u8fd9\u4e9b\u6323\u94b1\u4e86\u3002\u3002\u65e0\u5948\u4e14\u65e0\u52a9\u7684\u6211\u53ea\u80fd\u65e0\u89c6\u62a5\u9519\u4e86\uff0c\u76f4\u63a5\u6267\u884c\u4e0b\u4e00\u6b65\r\nmake install #\u611f\u8c22\u4e0a\u5e1d\u4f5b\u7956\u4fdd\u4f51\uff0c\u4e0a\u9762\u7684\u62a5\u9519\u53ea\u662ftest\u7684\u65f6\u5019\u5f15\u8d77\u7684\uff0cinstall\u7adf\u7136\u6ca1\u6709\u62a5\u9519\u5b89\u88c5\u6210\u529f\u4e86\uff01\r\n<\/pre>\n

\u8fd8\u662f\u4fee\u6539 \/etc\/ld.so.conf \uff0c\u6dfb\u52a0 \/usr\/local\/ssl\/lib \uff0c\u4fee\u6539\u5b8c\u6bd5\u540e\u6267\u884cldconfig\u4f7f\u4fee\u6539\u751f\u6548<\/p>\n

\u5c06\u65b0\u5b89\u88c5\u7684openssl\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\uff0c\u8986\u76d6\u65e7\u7684openssl\uff0c\u6211\u8fd9\u91cc\u4fee\u6539\u7684\u662f \/etc\/profile \u6587\u4ef6\uff0c\u5728\u6700\u540e\u4e00\u884c\u6dfb\u52a0 export PATH=\/usr\/local\/ssl\/bin:$PATH \uff0c\u7136\u540e\u6267\u884c source \/etc\/profile \u5373\u53ef<\/p>\n

\u5b89\u88c5curl<\/strong><\/div>\n

\u8bbf\u95eecurl\u5b98\u7f51\uff0c\u4e0b\u8f7d\u6700\u65b0\u7684curl\u5305\uff0c\u6211\u4e0b\u8f7d\u7684\u662f\u6700\u65b0\u7684\u7a33\u5b9a\u7248\uff0c\u8fd8\u6709\u4e2a\u957f\u671f\u652f\u6301\u7248(\u4f46\u53ea\u66f4\u65b0\u5230\u4e24\u4e09\u5e74\u540e)\uff0c\u6ca1\u641e\u660e\u767d\u5b58\u5728\u7684\u610f\u4e49\u662f\u4ec0\u4e48\uff0c\u5f03\u4e4b\uff1b<\/p>\n

\u89e3\u538b\u7f29curl\u5b89\u88c5\u5305\uff0ccd\u5230\u89e3\u538b\u7f29\u76ee\u5f55\u4e0b\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\r\n.\/configure --prefix=\/usr\/local\/curl --with-ssl #\u6307\u5b9a\u5b89\u88c5\u76ee\u5f55\uff0c\u6307\u5b9a\u4f7f\u7528openssl\u8fdb\u884c\u7f16\u8bd1\uff0c  \r\n\u8fd9\u91cc\u5e76\u6ca1\u6709\u6307\u5b9a\u4e0a\u9762\u5b89\u88c5\u7684openssl\u7684\u5177\u4f53\u8def\u5f84\uff0c  \r\n\u731c\u6d4b\u5b89\u88c5\u811a\u672c\u91cc\u4f1a\u81ea\u52a8\u5230\/usr\/local\/lib\u4ee5\u53ca\u5176\u4ed6\u76ee\u5f55\u4e0b\u67e5\u627e\u76f8\u5173\u6587\u4ef6(\u6709\u719f\u6089c++\u7684\u540c\u5b66\u53ef\u4ee5\u7ed9\u89e3\u91ca\u4e0b)\r\nmake\r\nmake install #\u5f88\u795e\u5947\uff0c\u7adf\u7136\u6ca1\u62a5\u9519\uff0c\u6211\u90fd\u4e0d\u9002\u5e94\u4e86\u3002\u3002\r\n<\/pre>\n

\u5c06 \/usr\/local\/curl\/bin \u6dfb\u52a0\u5230 \/etc\/profile \u4e2d\u7684PATH\u524d\uff0c\u6267\u884c source \/etc\/profile \u4f7f\u73af\u5883\u53d8\u91cf\u7684\u4fee\u6539\u751f\u6548\uff1b<\/p>\n

\u6267\u884ccurl -V\uff0c\u5e76\u6d4b\u8bd5curl -k https\u547d\u4ee4\uff0c\u7ec8\u4e8e\u80fd\u6b63\u5e38\u8bfb\u53d6\u8bc1\u4e66\u548ckey\u6587\u4ef6\u8bbf\u95eehttps\u7ad9\u70b9\u4e86\uff0c\u641e\u5b9a\uff01<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/my.oschina.net\/u\/580449\/blog\/1601317<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/redhat7-curl-https.html<\/a>\u7f16\u8f91\uff1a\u738b\u6bc5\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u95ee\u9898\u80cc\u666f \u6211\u4eec\u7684\u9879\u76ee\u8981\u62ff\u5230\u5ba2\u6237\u673a\u4e0a\u505a\u79c1\u6709\u5316\u5b89\u88c5\uff0c\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\u5ba2\u6237\u6307\u5b9a\u53ea\u80fd\u4f7f\u7528redhat7.2\u7248\u672c\uff0c\u4e14\u5ba2\u6237\u673a […]<\/p>\n","protected":false},"author":564,"featured_media":100752,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-100751","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/100751","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/564"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=100751"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/100751\/revisions"}],"predecessor-version":[{"id":292423,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/100751\/revisions\/292423"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/100752"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=100751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=100751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=100751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}