Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Suppress SSL certificate warnings when ssl_verify=False is set? #240

Open
victorhooi opened this issue Sep 3, 2015 · 16 comments
Open

Suppress SSL certificate warnings when ssl_verify=False is set? #240

victorhooi opened this issue Sep 3, 2015 · 16 comments
Assignees

Comments

@victorhooi
Copy link

I'm using influxdb-python with an InfluxDB instance with a self-signed SSL certificate.

I have ssl=True, and ssl_verify=False is on by default (although I have also tried explicitly setting it):

However, I am still seeing this when I attempt to write a point to InfluxDB:

/usr/local/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html

Since ssl_verify=False is being set, would it be possible to suppress these warnings please?

Whether ssl_verify=False should be on by default or not is a separate topic, I guess, but it seems like if it is set to False, then we should respect that, and not print out messages each and every time we make a request =).

Thoughts?

@victorhooi
Copy link
Author

Also, I should add that trying to use:

import urllib3
urllib3.disable_warnings()

did not make a difference, I still saw the warning messages.

@geodimm
Copy link
Contributor

geodimm commented Sep 14, 2015

Hi there,

Can you try suppressing warnings like this:

import requests
requests.packages.urllib3.disable_warnings() 

@beer4duke
Copy link

Hi @georgijd,
your suggestion works, but I feel the same: if one explicitly set ssl_verify=False influxdb client should issue a warning and then urllib3 warnings should be disabled, otherwise you get one warning per DB request and there are tons of those.

@sebito91
Copy link
Contributor

sebito91 commented Jul 7, 2017

We'll look into this, it's annoying I know!

@arslanqxgrid
Copy link

Thanks @georgijd worked for me 👍

@halmartin
Copy link

@sebito91 Has there been any progress?

The behaviour of ssl_verify=False still results in the urllib3 errors being printed for each request. The workaround from @georgijd works, but it would be nice if the behaviour of influxdb-python with ssl_verify=False were fixed so this additional step was not necessary.

@sebito91
Copy link
Contributor

sebito91 commented Sep 8, 2017

Sorry, been afk for a time. Will look at this ASAP and get back to you.

@sebito91 sebito91 self-assigned this Sep 8, 2017
@bafitor
Copy link

bafitor commented Oct 6, 2017

Any updates regarding this issue?

@jelanij
Copy link

jelanij commented Nov 2, 2017

Are there any updates on this issue? The below code seems to have fixed the issue, but im wondering if you can create an update.

import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

@rizwan-kh
Copy link

@shoother813 yes, this works perfectly to suppress sslwarning

pkovalev88 added a commit to pkovalev88/docker-curator that referenced this issue Dec 31, 2019
There are a lot of warnings in curator job like this "InsecureRequestWarning: Unverified HTTPS request is being made..."
This is expected behavior by https://www.elastic.co/guide/en/elasticsearch/client/curator/current/configfile.html#ssl_no_validate, but it is very annoying, so this fix disabled these warnings, see influxdata/influxdb-python#240 (comment)
@Arvanaghi
Copy link

What's the best way to tell Flask/Influxdb-Python to trust the self-signed certificate that InfluxDB uses, rather than merely suppressing the warning?

@drrtuy
Copy link

drrtuy commented Jun 22, 2020

@Arvanaghi I suppose using the same way as with other SSL/TLS clients, namely import a CA used to produce self-signed certificate.

@sysadmin-info
Copy link

sysadmin-info commented Sep 26, 2020

I'm using influxdb-python with an InfluxDB instance with a self-signed SSL certificate.

I have ssl=True, and ssl_verify=False is on by default (although I have also tried explicitly setting it):

However, I am still seeing this when I attempt to write a point to InfluxDB:

/usr/local/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html

Since ssl_verify=False is being set, would it be possible to suppress these warnings please?

Whether ssl_verify=False should be on by default or not is a separate topic, I guess, but it seems like if it is set to False, then we should respect that, and not print out messages each and every time we make a request =).

Thoughts?

I have a question how did you do that, just because I wish I could know how to force python to use https, just because I have different error:
influxdb.exceptions.InfluxDBClientError: 400: Client sent an HTTP request to an HTTPS server.
And I wish I could know where to look for the proper solution.,

@tcpdump-examples
Copy link

These InsecureRequestWarning warning messages show up when a request is made to an HTTPS URL without certificate verification enabled.
try this..
3 ways to fix insecurerequestwarning

@shahesam84
Copy link

both @georgijd solution and ssl_verify=False is needed to suppress the warnings.

@h3tz
Copy link

h3tz commented Oct 12, 2022

Hi there,

Can you try suppressing warnings like this:

import requests
requests.packages.urllib3.disable_warnings() 

works for me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests