influxdb-python
influxdb-python copied to clipboard
Suppress SSL certificate warnings when ssl_verify=False is set?
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?
Also, I should add that trying to use:
import urllib3
urllib3.disable_warnings()
did not make a difference, I still saw the warning messages.
Hi there,
Can you try suppressing warnings like this:
import requests
requests.packages.urllib3.disable_warnings()
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.
We'll look into this, it's annoying I know!
Thanks @georgijd worked for me 👍
@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.
Sorry, been afk for a time. Will look at this ASAP and get back to you.
Any updates regarding this issue?
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)
@shoother813 yes, this works perfectly to suppress sslwarning
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 I suppose using the same way as with other SSL/TLS clients, namely import a CA used to produce self-signed certificate.
I'm using influxdb-python with an InfluxDB instance with a self-signed SSL certificate.
I have
ssl=True, andssl_verify=Falseis 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.htmlSince
ssl_verify=Falseis being set, would it be possible to suppress these warnings please?Whether
ssl_verify=Falseshould 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.,
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
both @georgijd solution and ssl_verify=False is needed to suppress the warnings.
Hi there,
Can you try suppressing warnings like this:
import requests requests.packages.urllib3.disable_warnings()
works for me