Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1495

How do I fix SSL_verify_failed without bypass (verify=False)?

$
0
0

I am trying to get a cookie (and rest of the page) from a web site with cookie verification using requests library, but it fails on SSL certificate verification:

HTTPSConnectionPool(host='***host***', port=443): Max retries exceeded with url: ***url*** (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))

I can bypass it using verify=False, but that is unsecure. I can parse certificates but this is overkill. pip install certifi is not doing anything. How do I fix this?

My code:

import requestsheaders = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36'}r = requests.get('https://secure.ulrichsw.cz/estrava/, headers=headers, verify=True)session_id = r.cookies['PHPSESSID']print(session_id)

Viewing all articles
Browse latest Browse all 1495

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>