Skip to content

fix SSL error#78

Open
shelltdf wants to merge 1 commit intoskaslev:masterfrom
shelltdf:master
Open

fix SSL error#78
shelltdf wants to merge 1 commit intoskaslev:masterfrom
shelltdf:master

Conversation

@shelltdf
Copy link
Copy Markdown

No description provided.

@Kos
Copy link
Copy Markdown

Kos commented Sep 13, 2022

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

@microdee
Copy link
Copy Markdown

microdee commented Feb 28, 2023

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.

@pierre-dejoue
Copy link
Copy Markdown

pierre-dejoue commented Aug 15, 2023

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.

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

Successfully merging this pull request may close these issues.

4 participants