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
cuijiudai
V2EX  ›  Python

求解 python ssl 连接问题

  •  
  •   cuijiudai · 2013-08-26 18:17:42 +08:00 · 4918 次点击
    这是一个创建于 3902 天前的主题,其中的信息可能已经有所发展或是发生改变。
    在用 requests , 但是向 https post 表单的时候会报错,提示requests.exceptions.SSLError: [Errno 1] _ssl.c:499: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    3 条回复    1970-01-01 08:00:00 +08:00
    raptor
        1
    raptor  
       2013-08-27 09:22:21 +08:00
    在post调用时加一个参数:verify=False即可。
    原因是你请求的HTTPS服务器用的证书不被你的客户端所接受(比如是一些免费证书或自签名证书)。
    注意,这个要慎用,有安全性风险。
    cuijiudai
        2
    cuijiudai  
    OP
       2013-08-27 15:23:28 +08:00
    @raptor 不可以哦,登录不成功,能加入证书验证吗
    raptor
        3
    raptor  
       2013-09-04 09:20:57 +08:00
    @cuijiudai 应该可以,不过估计会比较麻烦,我没有试过。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2064 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 01:25 · PVG 09:25 · LAX 18:25 · JFK 21:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.