SSL通过OAuth抛出错误185090050验证时 [英] SSL throwing error 185090050 while authentication via Oauth

查看:599
本文介绍了SSL通过OAuth抛出错误185090050验证时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用谷歌的OAuth连接到谷歌的AdSense和我收到此错误。
任何线索修复它?

在任何Python已经面临这样一个问题之前?

 回溯(最后最近一次调用):
    文件get_all_saved_reports.py56行,上述<&模块GT;
      主(sys.argv中)
    文件get_all_saved_reports.py36行,在主
        服务= sample_utils.initialize_service()
    文件/home/nis​​h/Programs/python/google-adsense/samples/adsense/sample_utils.py线114,在initialize_service
        凭据= prepare_credentials()
    文件/home/nis​​h/Programs/python/google-adsense/samples/adsense/sample_utils.py,95线,在prepare_credentials
        凭据=跑(流量,存储)
      文件/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/util.py,128线,在positional_wrapper
        返回包裹(* ARGS,** kwargs)
      文件/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/tool​​s.py,197线,在运行
        凭据= flow.step2_exchange(code,HTTP = HTTP)
      文件/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/util.py,128线,在positional_wrapper
        返回包裹(* ARGS,** kwargs)
      文件/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/client.py,1283线,在step2_exchange
        头=头)
      文件/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py,1571线,在请求
        (响应,内容)= self._request(康涅狄格州,权威,URI,REQUEST_URI,方法,身体,头,重定向,cachekey)
      文件/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py,线路1318,在_REQUEST
        (响应,内容)= self._conn_request(康涅狄格州,REQUEST_URI,方法,身体,头部)
      文件/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py,行1253年,在_conn_request
        conn.connect()
      文件/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py,1022线,在连接
        self.disable_ssl_certificate_validation,self.ca_certs)
      文件/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py,80线,在_ssl_wrap_socket
    cert_reqs = cert_reqs,ca_certs = ca_certs)
  文件/usr/lib/python2.7/ssl.py,381线,在wrap_socket
    密码=密码)
  文件/usr/lib/python2.7/ssl.py,141线,在__init__
    密码)
ssl.SSLError:[错误185090050] _ssl.c:340:错误:0B084002:X509证书套路:X509_load_cert_crl_file:系统库


解决方案

我与Python 2.7.5中获得的OAuth2(Twitter的API,而不是谷歌)这个确切X509错误和使用阿克沙伊腐烂的建议,改变了上cacerts的权限以txt

  CHMOD 644 /usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/cacerts.txt

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

I am trying use Google's Oauth to connect to Google adsense and am getting this error. Any clues to fix it?

Anyone has faced such a issue before in python?

    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

解决方案

I was getting this exact x509 error in oauth2 (for Twitter API, not Google) with Python 2.7.5 and used Akshay Valsa's advice and changed the permissions on cacerts.txt with

chmod 644 /usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/cacerts.txt

That fixed the problem and I can now run my module as an ordinary user instead of sudoing it. Thanks!

这篇关于SSL通过OAuth抛出错误185090050验证时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆