psf / requests

A simple, yet elegant, HTTP library.
https://requests.readthedocs.io/en/latest/
Apache License 2.0
52.1k stars 9.31k forks source link

SSL certs aren't working with https://graph.facebook.com in Mac OS #742

Closed yeeland closed 12 years ago

yeeland commented 12 years ago

I hope it's not something I'm doing wrong but...

import requests requests.get('https://graph.facebook.com')

and I get this:

requests.exceptions.SSLError: [Errno 1] _ssl.c:480: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

in line 604 of requests/models.py

My cert_loc seems to be going with the DEFAULT_CA_BUNDLE_PATH, which is certifi/cacert.pem.

I made sure that I have the latest certifi, too. Anyone have any ideas?

kennethreitz commented 12 years ago

Usually an OpenSSL version difference.

yeeland commented 12 years ago

Looks like I was on 0.9.8r. I just upgraded to 1.0.1c and I'm still getting the same error.

kennethreitz commented 12 years ago

Please make sure you're using the latest version of Requests as well.

kennethreitz commented 12 years ago

Closing until further reports emerge.

aodj commented 11 years ago

I'm having exactly this issue on MacOSX 10.8.3 with OpenSSL 0.9.8r Feb 2011. My Windows 7 machine will connect and verify just fine, but the Mac throws the SSL3_GET_SERVER_CERTIFICATE:certificate verify failed error as listed above. This is using 1.2.0 of requests, Python 2.7.2 (On Mac)/Python 2.7 (on Windows).

Lukasa commented 11 years ago

What URL is causing it? I have the same setup, so I'm interested to see if I can reproduce it.

aodj commented 11 years ago

connection = requests.get(u'https://forums.eveonline.com', verify=True, stream=True)

Lukasa commented 11 years ago

Hmm, works fine for me. What version of Requests are you using?

sigmavirus24 commented 11 years ago

For me:

>>> import requests 
>>> r = requests.get('https://forums.eveonline.com', verify=True, stream=True)
>>> r
<Response [200]>
>>> q = requests.get('https://graph.facebook.com')
>>> q
<Response [400]>

On linux with python 2.6 and python 3.2. I think python 2.7.4 (which was recently released) contained some corrections to the ssl module, could you try installing that?

t-8ch commented 11 years ago

For me the same as for sigmavirus24 with py26,27,31 and 32. What response does the following give you?

openssl s_client -connect forums.eveonline.com:443  -CAfile `python -c 'import requests; print(requests.certs.where())'`

(Note the backticks)

The commandline version has much better error reporting than pythons' version.