Fix warning "InsecureRequestWarning Unverified HTTPS request is being made"
See original GitHub issueWhen 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:
- Created 7 years ago
- Comments:15 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
By default
Create Session
usesverify=False
Try to set it to True like in: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:
– Arik Aharoni