SSL error
Closed this issue · 12 comments
I updated to the latest api version and now I am getting these ssl errors -
FoursquareException: Error connecting with foursquare API: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Any idea what is going on?
I am OS X 10.9
Foursquare updates their SSL certs regularly, you may need to update your requests to 2.1
Same issue here.
foursquare.FoursquareException: Error connecting with foursquare API: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
@delciotorres Are you using Anaconda python distribution? I switched to a homebrew built python and the problem went away. However I also updated requests to the latest release which caused another issue -
The url params get double encoded. For eg. New York is encoded by this api as New%20York and requests further encodes it as New%2520York. I manually disabled the encoding in this api for now, but I am still trying to figure out the best way to turn off encoding in requests.
Pretty sure this is related to your Python distribution. SSL certs were working fine for me using requests 2.0.1
, and continue to work for me in requests 2.1.0
.
Definite encoding issue with requests 2.1.0
that I'm working on though.
@mLewisLogic I couldn't find any way to disable encoding with requests 2.1.0. Since 4sq obeys standard encoding rules now, it might be better to let requests do the encoding and disable encoding in this API.
What I did was manually download, the foursquare module and change it
"temporarily" to disable SSL credential check:
changed line 784 from:
response = requests.get(url, headers=headers, params=param_string)
to:
response = requests.get(url, headers=headers, params=params, verify=False)
On Tue, Dec 17, 2013 at 7:05 PM, S notifications@github.com wrote:
@mLewisLogic https://github.com/mLewisLogic I couldn't find any way to
disable encoding with requests 2.1.0. Since 4sq obeys standard encoding
rules now, it might be better to let requests do the encoding and disable
encoding in this API.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/39#issuecomment-30790829
.
This option should help: bd3e7e7
About to be uploaded to pypi. Just modify the VERIFY_SSL
constant to False
.
Uploaded. Latest should give an easy workaround.
@Signalseeker 4sq is obeying standard encoding rules now? Any evidence or way to check that? It wasn't handling the pluses in quote_plus'd strings for quite some time.
shouldn't you also expose the old CUSTOM_SSL_CERT variable? requests does expose this mechanism http://www.python-requests.org/en/latest/user/advanced/#ssl-cert-verification
Wasn't planning on it, but if you send a PR I'll get it merged.
ah looks like I misread requests doc, you can set VERIFY_SSL to the path for CA_BUNDLE file and it will work as the old CUSTOM_SSL_CERT did.