influxdb-python icon indicating copy to clipboard operation
influxdb-python copied to clipboard

Suppress SSL certificate warnings when ssl_verify=False is set?

Open victorhooi opened this issue 10 years ago • 16 comments

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 avatar Sep 03 '15 04:09 victorhooi

Also, I should add that trying to use:

import urllib3
urllib3.disable_warnings()

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

victorhooi avatar Sep 03 '15 04:09 victorhooi

Hi there,

Can you try suppressing warnings like this:

import requests
requests.packages.urllib3.disable_warnings() 

geodimm avatar Sep 14 '15 08:09 geodimm

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.

beer4duke avatar Feb 17 '17 10:02 beer4duke

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

sebito91 avatar Jul 07 '17 01:07 sebito91

Thanks @georgijd worked for me 👍

arslanqxgrid avatar Jul 18 '17 09:07 arslanqxgrid

@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.

halmartin avatar Aug 28 '17 13:08 halmartin

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

sebito91 avatar Sep 08 '17 02:09 sebito91

Any updates regarding this issue?

bafitor avatar Oct 06 '17 14:10 bafitor

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)

jelanij avatar Nov 02 '17 04:11 jelanij

@shoother813 yes, this works perfectly to suppress sslwarning

rizwan-kh avatar Mar 21 '18 10:03 rizwan-kh

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?

Arvanaghi avatar Apr 05 '20 19:04 Arvanaghi

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

drrtuy avatar Jun 22 '20 11:06 drrtuy

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.,

sysadmin-info avatar Sep 26 '20 19:09 sysadmin-info

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

tcpdump-examples avatar Jan 31 '22 09:01 tcpdump-examples

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

shahesam84 avatar Jun 04 '22 15:06 shahesam84

Hi there,

Can you try suppressing warnings like this:

import requests
requests.packages.urllib3.disable_warnings() 

works for me

h3tz avatar Oct 12 '22 18:10 h3tz