V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wdg8106
V2EX  ›  Python

用 pycurl 时,时不时报这个错: pycurl.error: (35, 'error reading X.509 key or certificate file'),请问这个是什么问题呢。

  •  
  •   wdg8106 · 2016-03-28 10:48:01 +08:00 · 3513 次点击
    这是一个创建于 2952 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我是在微信支付的时候用 prcurl 发的请求,网上有的说是因为并发引起的,但是我在发支付请求的时候根本不需要证书,也没带证书,为什么会报证书错误的问题呢,

    有谁知道怎么解决么,先谢过了~~
    5 条回复    2016-04-07 13:44:52 +08:00
    micyng
        1
    micyng  
       2016-03-28 12:30:09 +08:00 via Android
    ssl 握手阶段服务器证书没下载成功?
    ubear1991
        2
    ubear1991  
       2016-03-28 13:32:31 +08:00
    我也感觉是证书问题。
    kungfuchicken
        3
    kungfuchicken  
       2016-03-28 14:15:00 +08:00   ❤️ 1
    可能是 pycurl 使用 gnutls 库而不是 openssl 库导致的,检测方法
    >>> import pycurl
    >>> pycurl.version
    显示下面用的是 gnutls
    'libcurl/7.18.2 GnuTLS/2.4.2 zlib/1.2.3.3 libidn/1.8
    显示下面用的是 openssl
    'libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18'
    你打印看看?
    wdg8106
        4
    wdg8106  
    OP
       2016-03-28 16:58:31 +08:00
    @kungfuchicken 太感谢了, 打印的是
    PycURL/7.19.3 libcurl/7.35.0 GnuTLS/2.12.23 zlib/1.2.8 libidn/1.28 librtmp/2.3',
    我更新一下 pycurl 的版本就好了
    wdg8106
        5
    wdg8106  
    OP
       2016-04-07 13:44:52 +08:00
    http://serverfault.com/questions/348815/how-to-change-libcurl-ssl-backend-from-gnutls-to-openssl-on-ubuntu-server
    最后附上更换库的方式,希望能帮到遇到和我一样问题的人
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2952 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:01 · PVG 21:01 · LAX 06:01 · JFK 09:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.