{"id":204962,"date":"2025-05-29T14:19:33","date_gmt":"2025-05-29T06:19:33","guid":{"rendered":"https:\/\/server.hk\/cnblog\/204962\/"},"modified":"2025-05-29T14:19:33","modified_gmt":"2025-05-29T06:19:33","slug":"%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3-python-%e4%b8%ad%e7%9a%84-attributeerror-module-lib-has-no-attribute-x509_v_flag_cb_issuer_check-%e9%94%99%e8%af%af%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/204962\/","title":{"rendered":"\u5982\u4f55\u89e3\u51b3 Python \u4e2d\u7684 AttributeError: module &#8216;lib&#8217; has no attribute &#8216;X509_V_FLAG_CB_ISSUER_CHECK&#8217; \u9519\u8bef\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u89e3\u51b3 Python \u4e2d\u7684 AttributeError: module &#8216;lib&#8217; has no attribute &#8216;X509_V_FLAG_CB_ISSUER_CHECK&#8217; \u9519\u8bef\uff1f<\/h1>\n<p>\u5077\u5077\u52aa\u529b\uff0c\u6084\u65e0\u58f0\u606f\u5730\u53d8\u5f3a\uff0c\u7136\u540e\u60ca\u8273\u6240\u6709\u4eba\uff01\u54c8\u54c8\uff0c\u5c0f\u4f19\u4f34\u4eec\u53c8\u6765\u5b66\u4e60\u5566~\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u4ecb\u7ecd\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4f1a\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u4e0d\u77e5\u9053\u5927\u5bb6\u5bf9\u5176\u90fd\u6709\u591a\u5c11\u4e86\u89e3\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u4e00\u8d77\u6765\u770b\u4e00\u5427\uff01\u5f53\u7136\uff0c\u975e\u5e38\u5e0c\u671b\u5927\u5bb6\u80fd\u591a\u591a\u8bc4\u8bba\uff0c\u7ed9\u51fa\u5408\u7406\u7684\u5efa\u8bae\uff0c\u6211\u4eec\u4e00\u8d77\u5b66\u4e60\uff0c\u4e00\u8d77\u8fdb\u6b65\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732087316673d8e14b75c1.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>librtls \u7684 x509_v_flag_cb_issuer_check \u9519\u8bef<\/strong><\/p>\n<p>\u5728\u5c1d\u8bd5\u5bfc\u5165 google api python \u5ba2\u6237\u7aef\u65f6\uff0c\u60a8\u53ef\u80fd\u4f1a\u9047\u5230\u5982\u4e0b\u9519\u8bef\uff1a<\/p>\n<pre>attributeerror: module 'lib' has no attribute 'x509_v_flag_cb_issuer_check'<\/pre>\n<p>\u8fd9\u662f\u7531\u4e8e\u4e0d\u517c\u5bb9\u7684\u6587\u4ef6\u635f\u574f\u800c\u91cd\u65b0\u5b89\u88c5 python \u5f15\u8d77\u7684\u3002\u4fee\u590d\u6b64\u9519\u8bef\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u7f16\u8f91 crypto.py \u6587\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p>\u627e\u5230\u5e76\u6ce8\u91ca\u6389 crypto.py \u6587\u4ef6\u4e2d\u7684\u4ee5\u4e0b\u884c\uff1a<\/p>\n<pre>cb_issuer_check = _lib.x509_v_flag_cb_issuer_check<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5347\u7ea7 pyopenssl\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>pip install pip --upgrade\npip install pyopenssl --upgrade<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5220\u9664\u6ce8\u91ca\uff1a<\/strong><\/p>\n<ul>\n<li>\u5347\u7ea7\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u518d\u6b21\u5220\u9664\u6ce8\u91ca\u884c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u91cd\u65b0\u5bfc\u5165 google api \u5ba2\u6237\u7aef\uff1a<\/strong><\/p>\n<ul>\n<li>\u91cd\u65b0\u8fd0\u884c\u5bfc\u81f4\u9519\u8bef\u7684\u4ee3\u7801\uff0c\u5b83\u5e94\u8be5\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u4eca\u5929\u5173\u4e8e\u300a\u5982\u4f55\u89e3\u51b3 Python \u4e2d\u7684 AttributeError: module &#8216;lib&#8217; has no attribute &#8216;X509_V_FLAG_CB_ISSUER_CHECK&#8217; \u9519\u8bef\uff1f\u300b\u7684\u5185\u5bb9\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\uff0c\u5982\u679c\u6709\u4ec0\u4e48\u7591\u95ee\u6216\u8005\u5efa\u8bae\uff0c\u53ef\u4ee5\u5728\u516c\u4f17\u53f7\u4e0b\u591a\u591a\u56de\u590d\u4ea4\u6d41\uff1b\u6587\u4e2d\u82e5\u6709\u4e0d\u6b63\u4e4b\u5904\uff0c\u4e5f\u5e0c\u671b\u56de\u590d\u7559\u8a00\u4ee5\u544a\u77e5\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u89e3\u51b3 Python \u4e2d\u7684 A&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-204962","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=204962"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204962\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=204962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=204962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=204962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}