我在拱 linux 上。
从以下位置复制了 gmail 示例:https ://developers.google.com/gmail/api/quickstart/python
该代码在 Ubuntu 上运行良好,但在 arch 上我有这个错误:
Traceback (most recent call last):
File "gmail.py", line 70, in <module>
main()
File "gmail.py", line 58, in main
credentials = get_credentials()
File "gmail.py", line 46, in get_credentials
credentials = tools.run_flow(flow, store, flags)
File "/usr/lib/python2.7/site-packages/oauth2client/util.py", line 140, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/oauth2client/tools.py", line 231, in run_flow
credential = flow.step2_exchange(code, http=http)
File "/usr/lib/python2.7/site-packages/oauth2client/util.py", line 140, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/oauth2client/client.py", line 2138, in step2_exchange
headers=headers)
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1609, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1351, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1272, in _conn_request
conn.connect()
File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 1059, in connect
raise SSLHandshakeError(e)
httplib2.SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
用其他 https 测试了 urllib2,它运行良好。
我不知道哪个可能是问题所在。