gl3w
gl3w copied to clipboard
fix SSL error
This just disables signature verification completely, why do you need to do it? What error are you experiencing?
I can confirm. Before this "fix" urllib2
complains about expired SSL certificates (at least on an up to date Windows 10), and imo compiling with headers from "unverified sources" is still better than not compiling at all.
I ran into a similar issue yesterday. For context, I'm using Git bash on Windows. I got the following error while running the script: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired
The way I solved it was to use a different SSL context:
import certifi
import ssl
...
certifi_context = ssl.create_default_context(cafile=certifi.where())
web = urllib2.urlopen(urllib2.Request(url, headers={'User-Agent': 'Mozilla/5.0'}), context=certifi_context)
(That requires pip install certifi
)
I'm writing here only to share the information. I have no opinion regarding if, and how, the main project should handle the issue.