Open mborus opened 3 years ago
Update: This seems to be a general Windows Python problem and it's fixable by manually installing the "ISRG Root X1" (https://letsencrypt.org/docs/certificate-compatibility/) - http://woshub.com/updating-trusted-root-certificates-in-windows-10/
Still it would be nice if an SSL error with the first URL would not stop the second one from working.
Hi, I still have the same error when initiating pgeocode.Nominatim. I tried to fix the code of pgeocode as suggusted and checked, if ISRG ROOT X1 is installed on my system (Win11). Still, I get the URLError mentioned before.
Do you have any ideas how to fix this issue?
Thanks, Paul
You can add ssl._create_default_https_context = ssl._create_unverified_context
in line 140 and 158 in pgeocode.py
as a temp.
Is there another way to solve this issue? adding ssl._create_default is apparently called monkey-patching
which is generally not a good practice.
having this same issue here.
Has there been any fix for this issue? I'm running into the same problem. The monkey-patching
suggested by @mborus did not work.
Thanks!
Has there been any fix for this issue? I'm running into the same problem. The
monkey-patching
suggested by @mborus did not work.Thanks!
I was still unable to get letsencrypt certificates validated even when ensuring "ISRG Root X1" and "ISRG Root X2" were installed.
The simplest solution was to go into pgeocode.py
and remove the url starting with https://download.geonames.org
from the DOWNLOAD_URL
array. The remaining url uses a digicert which has not issues with urllib.
Has there been any fix for this issue? I'm running into the same problem. The
monkey-patching
suggested by @mborus did not work. Thanks!I was still unable to get letsencrypt certificates validated even when ensuring "ISRG Root X1" and "ISRG Root X2" were installed.
The simplest solution was to go into
pgeocode.py
and remove the url starting withhttps://download.geonames.org
from theDOWNLOAD_URL
array. The remaining url uses a digicert which has not issues with urllib.
Wow, that worked! I can't believe it. Thank you!
you can also define the DOWNLOAD_URL var while running pgeocode and remove the s of https url : pgeocode.DOWNLOAD_URL = [ "http://download.geonames.org/export/zip/{country}.zip", "http://symerio.github.io/postal-codes-data/data/geonames/{country}.txt", ]
On windows 10 using Python 3.9.7 the quickstart example crashes at
with the error
This is probably caused by the Let's Encrypt certificate.
You can do a quick fix by either removing the first URL in line 25 in pgeocode.py or by turning off ssl verification in line 141