首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过Oauth进行身份验证时出现SSL抛出错误185090050

通过Oauth进行身份验证时出现SSL抛出错误185090050
EN

Stack Overflow用户
提问于 2013-03-29 10:39:37
回答 4查看 9.9K关注 0票数 8

我正在尝试使用Google的Oauth连接到Google adsense,并收到此错误。有什么线索可以解决这个问题吗?

以前有没有人在python中遇到过这样的问题?

代码语言:javascript
复制
    Traceback (most recent call last):
    File "get_all_saved_reports.py", line 56, in <module>
      main(sys.argv)
    File "get_all_saved_reports.py", line 36, in main
        service = sample_utils.initialize_service()
    File "/home/nish/Programs/python/google-adsense/samples/adsense/sample_utils.py", line 114, in initialize_service
        credentials = prepare_credentials()
    File "/home/nish/Programs/python/google-adsense/samples/adsense/sample_utils.py", line 95, in prepare_credentials
        credentials = run(FLOW, storage)
      File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/util.py", line 128, in positional_wrapper
        return wrapped(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/tools.py", line 197, in run
        credential = flow.step2_exchange(code, http=http)
      File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/util.py", line 128, in positional_wrapper
        return wrapped(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/client.py", line 1283, in step2_exchange
        headers=headers)
      File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1571, in request
        (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
      File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1318, in _request
        (response, content) = self._conn_request(conn, request_uri, method, body, headers)
      File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1253, in _conn_request
        conn.connect()
      File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1022, in connect
        self.disable_ssl_certificate_validation, self.ca_certs)
      File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 80, in _ssl_wrap_socket
    cert_reqs=cert_reqs, ca_certs=ca_certs)
  File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 141, in __init__
    ciphers)
ssl.SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2013-10-03 04:13:48

我在使用Python2.7.5的oauth2 (针对Twitter API,而不是谷歌)中得到了这个确切的x509错误,并使用Akshay Valsa的建议,使用以下命令更改了cacerts.txt上的权限

代码语言:javascript
复制
chmod 644 /usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/cacerts.txt

这解决了这个问题,我现在可以以普通用户的身份运行我的模块,而不是sudoing。谢谢!

票数 30
EN

Stack Overflow用户

发布于 2013-09-26 20:51:15

这个问题是在加载证书files.If时,您使用根用户运行程序时,此问题将得到解决。或者,您可以检查文件:/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/cacerts.txt,的权限,并为该文件提供必要的权限。

票数 7
EN

Stack Overflow用户

发布于 2014-03-16 13:25:50

在我的例子中,我运行的是Django开发服务器。如果服务器是在切换到虚拟环境之前运行的,我在回溯中发现Errno 185090050错误:_ssl.c:345: 0B084002:x509证书routines:X509_load_cert_crl_file:system库。简单地说,我不再运行创建证书的httplib2版本:我很可能运行dist-package。(Ububtu 13.10),Python 2.7,Django 1.62。希望这对其他人有帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15696526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档