Sorin Trimbitas Sorin Trimbitas - 1 month ago 23
Python Question

httplib.HTTPSConnection issue : CERTIFICATE_VERIFY_FAILED

I'm trying to access a website with httplib library but i'm getting this error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

c = httplib.HTTPSConnection('IP', 443)
c.request(method,url);


Because the certificate is self-signed. How can I disable the certificate verification?

Thanks!

Answer

How do I have python httplib accept untrusted certs?

httplib.HTTPSConnection(hostname, timeout=5, context=ssl._create_unverified_context())
Comments