gl3w icon indicating copy to clipboard operation
gl3w copied to clipboard

fix SSL error

Open shelltdf opened this issue 2 years ago • 3 comments

shelltdf avatar Sep 13 '22 08:09 shelltdf

This just disables signature verification completely, why do you need to do it? What error are you experiencing?

Kos avatar Sep 13 '22 10:09 Kos

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.

microdee avatar Feb 28 '23 10:02 microdee

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.

pierre-dejoue avatar Aug 15 '23 09:08 pierre-dejoue