Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL certificate verify failed #4

Closed
larryxiao opened this issue Mar 5, 2014 · 6 comments
Closed

SSL certificate verify failed #4

larryxiao opened this issue Mar 5, 2014 · 6 comments
Labels

Comments

@larryxiao
Copy link

Uploading file 'README.md'
remote path is '/apps/bypy/README.md'
'README.md' is small and being non-slicing uploaded.
POST https://c.pcs.baidu.com/rest/2.0/pcs/file
actargs: /apps/bypy/README.md
Params: {u'path': u'/apps/bypy/README.md', u'ondup': u'overwrite', u'method': u'upload'}
[18:44:49] Error accessing 'https://c.pcs.baidu.com/rest/2.0/pcs/file'
[18:44:49] Exception: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Traceback (most recent call last):
File "./bypy.py", line 810, in __request_work
params = parsnew, timeout = self.__timeout, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 88, in post
return request('post', url, data=data, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 383, in request
resp = self.send(prep, *_send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 486, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 385, in send
raise SSLError(e)
SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

@larryxiao
Copy link
Author

requests.get('https://github.com', verify=True) is fine
requests.get('https://c.pcs.baidu.com/rest/2.0/pcs/file', verify=True) produces error

saw your comment in http://www.douban.com/group/topic/48589513/
not sure what do you mean by
"
比较有用的更新:我现在测试,墙内也可以用了。
细节:用红帽的网站又搭了一个授权网页,貌似用https访问,不会被墙。
反映授权出错的童鞋,可以尝试一下最新版。
-- ibic 2014-03-05 02:50:27
"

@houtianze
Copy link
Owner

Hmm, strange. Now this SSLError is reported again. No idea why this happens (it shouldn't). Anyway, I think it can be worked-around by setting verify = False.

Maybe it's due to the requests library being too old? as stated here:
https://stackoverflow.com/questions/18999517/python-requests-certificate-verify-failed

See if upgrading the requests library solves the problem?

What i mean by those sentences is: The latest version of the script works even you are confined by the famous Great Fire Wall.

@larryxiao
Copy link
Author

by upgrading requests to 2.2.1 the problem remains
baidu's cert is valid indeed ...
thanks!

@houtianze
Copy link
Owner

so strange... yah, i also agree that Baidu's cert shouldn't have a problem.
i will run the script to do some up/download and see if i can reproduce first. i actually have uploaded a large number of files, so far, never encountered this.

@houtianze houtianze added the bug label Mar 8, 2014
@houtianze
Copy link
Owner

Maybe it's Python Requests library's problem, as discussed here:
https://stackoverflow.com/questions/10667960/python-requests-throwing-up-sslerror

Since I really can't confirm this, I just worked around it with verify = False. It should have resolved this SSL error.

@larryxiao
Copy link
Author

Yes, I think that explains it well.
And I think this issue can be closed
BTW.
Thanks for writing this useful tool!

@lifeike lifeike mentioned this issue Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants