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
#2
the gist of the security warning is that even HTTPS does not protect your web request being spoofed.  HTTPS would give you a secure connection to the spoofer.  as far as i know, this is an issue you need to raise with the check_dell_warranty.py developer(s).  it may that a newer version of the https module is more thorough in security checks.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#3
Yes sure, now we are using another plugin check_esxi_hardware.py and it works fine.

Thanks.
Reply


Forum Jump:

User Panel Messages

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