request fails on wikipedia (https) - certificate verify failed (_ss

Jon Ribbens jon+usenet at unequivocal.eu
Wed Dec 13 06:46:47 EST 2017


On 2017-12-11, F Massion <fmassion at web.de> wrote:
> Am Dienstag, 12. Dezember 2017 14:33:42 UTC+1 schrieb Jon Ribbens:
>> On 2017-12-11, F Massion <fmassion at web.de> wrote:
>> > ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
> (_ssl.c:748)
>>
>> Try `pip install certifi`
>
> certifi was installed.
> If I make the following changes I do not have the error message. I don't
> understand why, but this makes a difference:
>
> #import requests --> import urllib.request
>
> url = 'https://en.wikipedia.org/wiki/Stethoscope'
> #res = requests.get(url) --> res = urllib.request.urlopen(url).read()

That's because that won't even try to verify the SSL certificate.



More information about the Python-list mailing list