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 Failure #191

Closed
cbrum11 opened this issue Aug 30, 2017 · 6 comments
Closed

SSL Certificate Failure #191

cbrum11 opened this issue Aug 30, 2017 · 6 comments

Comments

@cbrum11
Copy link

cbrum11 commented Aug 30, 2017

Newbie here... go easy on me.

Copy and pasting your example code and adding my own API key gives me the following error:

HTTPSConnectionPool(host='maps.googleapis.com', port=443): Max retries exceeded with url: /maps/api/geocode/json?address=1600+Amphitheatre+Parkway%2C+Mountain+View%2C+CA&key=MY HIDDEN APIKEY (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)'),))

Advice?

@stephenmcd
Copy link
Contributor

This is a duplicate of #111

@cbrum11
Copy link
Author

cbrum11 commented Aug 31, 2017

EDIT: This solution is just a temporary workaround. A better solution is this comment.

In case someone else runs into this issue, I did not find my answer in #111 . I did, however, find a solution.

Rolling back the certifi module solved the problem...

pip uninstall -y certifi && pip install certifi==2015.04.28

@stephenmcd
Copy link
Contributor

Thanks for that solution!

@cbrum11
Copy link
Author

cbrum11 commented Aug 31, 2017

Actually, for a much better solution to this problem (and the ability to use the most up to date certifi module) do the following:

pip install pyOpenSSL

pip install requests[security]

To check that everything is the latest and greatest...

pip list

@llinfeng
Copy link

llinfeng commented Jul 1, 2019

I reproduced the same error a bit differently. Posting here for future reference:

I stood home in China for a couple of weeks, during which all Google services are cut off, including all the Google Cloud APIs. Long story short, I set up a Shadowsocks server on a VPS and found the following code snippet super helpful on a Windows 10 machine running a Shadowsocks client on Port 7070

# Setups
import socket
from httplib2 import socks

#Socks5 proxy
socket.socket = socks.socksocket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 7070)

Usage: put these things before initializing the googlemaps.client.Client object. (These code are not mine, and I forget how I ran into it. Please advise if you know the source.)

After returning back to my office, I made a mistake of running the same Jupyter codebook on a Linux machine: so far, it does not even have socket installed. Thus came the exact same error message. Commenting out the code snippet above and restarting the kernel for the Jupyter notebook helped solve the problem.

@EraProphet
Copy link

@llinfeng very very very thank you , this solution succeeded in my problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants