[英]Authentication failed: [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
I am using python 2.7.6, Django 1.8 and python-social-auth. 我正在使用python 2.7.6,Django 1.8和python-social-auth。 While trying to authenticate via googleoauth2 I am getting this error. 尝试通过googleoauth2进行身份验证时,出现此错误。 The traceback is attached. 追溯已附加。 I have tried these - 我已经尝试过这些-
sudo apt-get install ca-certificates
sudo apt-get install ntpdate
But even then its not working. 但是即使这样它也不起作用。
Traceback:
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
58. return view_func(*args, **kwargs)
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/social/apps/django_app/utils.py" in wrapper
51. return func(request, backend, *args, **kwargs)
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/social/apps/django_app/views.py" in complete
28. redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/social/actions.py" in do_complete
43. user = backend.complete(user=user, *args, **kwargs)
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/social/backends/base.py" in complete
41. return self.auth_complete(*args, **kwargs)
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/social/utils.py" in wrapper
229. return func(*args, **kwargs)
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/social/backends/oauth.py" in auth_complete
383. method=self.ACCESS_TOKEN_METHOD
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/social/backends/oauth.py" in request_access_token
361. return self.get_json(*args, **kwargs)
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/social/backends/base.py" in get_json
229. return self.request(url, *args, **kwargs).json()
File "/home/ashish/.virtualenvs/ch_web_app/local/lib/python2.7/site-packages/social/backends/base.py" in request
224. raise AuthFailed(self, str(err))
Exception Type: AuthFailed at /complete/google-oauth2/
Exception Value: Authentication failed: [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
pip2.7 install --upgrade httplib2
上面的解决方案对我有用
I faced the same issue. 我遇到了同样的问题。 Try doing pip install urllib3[secure]
, urllib3 doesn't have certs by default so you have to do this. 尝试执行pip install urllib3[secure]
,默认情况下urllib3没有证书,因此您必须这样做。 This is also shown here --> https://urllib3.readthedocs.org/en/latest/security.html#security 这也显示在这里-> https://urllib3.readthedocs.org/en/latest/security.html#security
you can install the following package 您可以安装以下软件包
python -m pip install pyopenssl pyasn1 ndg-httpsclient
I got the same issue resolved by installing the above library. 通过安装上述库,我解决了相同的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.