question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix warning "InsecureRequestWarning Unverified HTTPS request is being made"

See original GitHub issue

When using robotframework-requests with https, we get a warning.

Repro steps:

Put this in file google.robot

*** Settings ***
Documentation     A test suite to show https redirects triggers a warning
Library           RequestsLibrary

*** Test Cases ***

Check correct redirect from http://google.com
  Create Session    session1    https://www.google.com
  ${resp}=    Get Request    session1    /    allow_redirects=${false}
   Should Be Equal As Strings    ${resp.status_code}    302

   Log    ${resp.headers['Location']}

Then execute with:

$ robot google.robot
==============================================================================
Google :: A test suite to show https redirects triggers a warning
==============================================================================
Check correct redirect from http://google.com                         ./Users/username/dev/tests/python/robotframework/.venv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:838: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
Check correct redirect from http://google.com                         | PASS |
------------------------------------------------------------------------------
Google :: A test suite to show https redirects triggers a warning     | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  /Users/username/dev/tests/python/robotframework/output.xml
Log:     /Users/username/dev/tests/python/robotframework/log.html
Report:  /Users/username/dev/tests/python/robotframework/report.html

The part

./Users/username/dev/tests/python/robotframework/.venv/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:838: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)

doesn’t look that good. How to make it go away?

Same result with: robot --console quiet google.robot

Versions

$ robot --version
Robot Framework 3.0 (Python 2.7.12 on darwin)

$ uname -a
Darwin apollo 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

30reactions
HelioGuilherme66commented, Sep 30, 2016

By default Create Session uses verify=False Try to set it to True like in:

Create Session    session1    https://www.google.com    verify=True
7reactions
Arikahcommented, Sep 16, 2019

You can hide this warning by:

import warning from requests.packages.urllib3.exceptions import InsecureRequestWarning warnings.simplefilter(‘ignore’,InsecureRequestWarning) requests.get(…, verify=False)

On Mon, Sep 16, 2019 at 2:23 PM Bhaskar447 notifications@github.com wrote:

hi, I am using request library in python. when we try to execute the HTTPS request i am getting the follwing error.

request :response = requests.request(“GET”, url, headers=headers, params=params,verify=True)

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 https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bulkan/robotframework-requests/issues/135?email_source=notifications&email_token=AANNLGH5F7NI5PCZFWJLKH3QJ5UB7A5CNFSM4CRNEY4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6Y2RLY#issuecomment-531736751, or mute the thread https://github.com/notifications/unsubscribe-auth/AANNLGEF233A4W6NR5ZC5K3QJ5UB7ANCNFSM4CRNEY4A .

– Arik Aharoni

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unverified HTTPS request is being made in Python2.6 ...
You can disable any Python warnings via the PYTHONWARNINGS environment variable. In this case, you want: export PYTHONWARNINGS="ignore:Unverified HTTPS ...
Read more >
InsecureRequestWarning Unverified HTTPS request is ...
This happens when a request is made to an HTTPS URL without certificate verification enabled. Follow the certificate verification guide to ...
Read more >
How to disable InsecureRequestWarning: Unverified ...
How to disable InsecureRequestWarning: Unverified HTTPS request is being made. If you use requests or urllib3, requests with SSL ...
Read more >
3 Ways to Fix InsecureRequestWarning in Python
These InsecureRequestWarning warning messages show up when a request is made to an HTTPS URL without certificate verification enabled.
Read more >
unverified HTTPS in /var/log/messages - Forums
Has anyone an idea on how to fix this ? Does it have anything to do with the fact that I ... InsecureRequestWarning:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found