1

When I try to access any HTTP website, even one of the most popular, I get a SSL warning from urllib3 module.

>>> import urllib3
>>> http = urllib3.PoolManager()
>>> http.request("GET", "https://www.google.de")
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
<urllib3.response.HTTPResponse object at 0x7f5251466c90>
>>> 

Can somebody please help me getting this fixed?

Unfortunately I have to use a API that is apparently using urllib3 under the hood to do the actual REST calls.

So I have to get it fixed w/o avoiding urllib3 module. I've already checked the ca certificates using ssl.SSLContext.get_ca_certs() which contains the CA certificate. Doing the same with curl or openssl, works without any verification warnings.

Thanks in advance.

Alex
  • 43
  • 3
  • Why not just suppress the messages. https://stackoverflow.com/questions/27981545/suppress-insecurerequestwarning-unverified-https-request-is-being-made-in-pytho – scotts May 29 '20 at 22:34
  • 1
    Not only since the documentation of **urllib3** writes _Making unverified HTTPS requests is strongly discouraged_, I haveto get it working with the SSL certificate verified. I have to get notice, once there is something wrong with the certificate. – Alex May 29 '20 at 22:38
  • Did you try to follow the docs for Python 2 & urllib3? https://urllib3.readthedocs.io/en/latest/user-guide.html#certificate-verification-in-python-2 – schlenk May 29 '20 at 22:48

0 Answers0