我正在尝试让用于 Google Plus API 的命令行 Python 启动器工作,但在身份验证完成后,我遇到了这个错误:
ssl.SSLError: [Errno 185090050] _ssl.c:336: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
我在跑步Python 2.7 on Ubuntu 11.04
。API 用于httplib2
发送请求。我正在运行入门工具包localhost
。
这是终端转储:
Traceback (most recent call last):
File "/home/vijay/Downloads/google-plus-python-starter/cli/plus_cli.py", line 114, in <module>
main()
File "/home/vijay/Downloads/google-plus-python-starter/cli/plus_cli.py", line 62, in main
credentials = authorize_self(settings.CLIENT_ID,settings.CLIENT_SECRET)
File "/home/vijay/Downloads/google-plus-python-starter/cli/plus_cli.py", line 48, in authorize_self
credentials = run(flow, storage)
File "/home/vijay/Downloads/googleapi/oauth2client/tools.py", line 146, in run
credential = flow.step2_exchange(code)
File "/home/vijay/Downloads/googleapi/oauth2client/client.py", line 698, in step2_exchange
headers=headers)
File "/home/vijay/Downloads/googleapi/httplib2/__init__.py", line 1436, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/home/vijay/Downloads/googleapi/httplib2/__init__.py", line 1188, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/home/vijay/Downloads/googleapi/httplib2/__init__.py", line 1123, in _conn_request
conn.connect()
File "/home/vijay/Downloads/googleapi/httplib2/__init__.py", line 890, in connect
self.disable_ssl_certificate_validation, self.ca_certs)
File "/home/vijay/Downloads/googleapi/httplib2/__init__.py", line 76, in _ssl_wrap_socket
cert_reqs=cert_reqs, ca_certs=ca_certs)
File "/usr/lib/python2.7/ssl.py", line 344, in wrap_socket
ciphers=ciphers)
File "/usr/lib/python2.7/ssl.py", line 119, in __init__
ciphers)
ssl.SSLError: [Errno 185090050] _ssl.c:336: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib`
我试图让这个工作的事情:
- 手动将 cacerts.txt 从复制
http://httplib2.googlecode.com/hg-history/6525cadfde53279479533c1235e2661f5c147afc/python2/httplib2/cacerts.txt
到/usr/lib/python2.7/dist-packages/httplib2
- 更新
httplib2
到最新版本 0.7.1 - 在从入门工具包 (plus_cli.py) 中的文件进行的所有 httplib2 调用中禁用 SSL,使用
httplib2.Http(disable_ssl_certificate_validation=True)
我没有想法,需要你的帮助来解决这个问题。