Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
InsecureRequestWarning
#1
Hello,

I'm new with python, i have download the plugin check_dell_warranty.py to monitor our DELL servers warranty but when i try to execute the script i have the following errors:

Quote:/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See:  h t t p s : / / urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
Unable to contact url:  h t t p s : / / api.dell.com/support/v2/assetinfo/warranty/tags.json


I tried following solution but still the same error: 

Quote:urllib3.readthedocs.io /en/latest/advanced-usage.html#ssl-warnings


1- Disabling the warning still the same error: 

Quote:>>> import urllib3
>>> urllib3.disable_warnings()

2- Verification of the certificate with Python 2.7 still the same error:

Quote:pip install urllib3[secure]
>>> import urllib3.contrib.pyopenssl
>>> urllib3.contrib.pyopenssl.inject_into_urllib3()

>>> import certifi
>>> import urllib3
>>> http = urllib3.PoolManager(
...    cert_reqs='CERT_REQUIRED',
...    ca_certs=certifi.where())

  3- Upgrading from Python 2.7 to 3.5 and did the steps for Python 3.xx still the same error:

Quote:pip install certifi
pip install urllib3[secure]
>>> import certifi
>>> import urllib3
>>> http = urllib3.PoolManager(
...    cert_reqs='CERT_REQUIRED',
...    ca_certs=certifi.where())
 

Even when i tried to validate the certificate for h t t p s : / / google.com i got an error:

Quote:>>> http.request('GET', 'h t t p s : / / google.com')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'http' is not defined

CentOS 7 as operating system. 

Please any help !

Thank you.
Reply


Messages In This Thread
InsecureRequestWarning - by Debian - Mar-17-2017, 02:00 PM
RE: InsecureRequestWarning - by Skaperen - Mar-21-2017, 02:44 AM
RE: InsecureRequestWarning - by Debian - Apr-27-2017, 06:11 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020