Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to InfluxDB with self signed certificate #134

Closed
flyinggorilla opened this issue Jul 18, 2020 · 4 comments · Fixed by #136
Closed

Cannot connect to InfluxDB with self signed certificate #134

flyinggorilla opened this issue Jul 18, 2020 · 4 comments · Fixed by #136
Milestone

Comments

@flyinggorilla
Copy link

There is no "verify=False" option anymore, so i cannot migrate from the old to the new Python client.

also the classic workaround of

import urllib3
urllib3.disable_warnings()

doesnt work. Win 10, urllib3 1.25.9, python 3.8.3 windows/x64

Starting new HTTPS connection (4): localhost:8086
Traceback (most recent call last):
  File "C:\Users\f\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "C:\Users\f\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "C:\Users\f\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 976, in _validate_conn
    conn.connect()
  File "C:\Users\f\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 361, in connect
    self.sock = ssl_wrap_socket(
  File "C:\Users\f\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\ssl_.py", line 377, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "C:\Users\f\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\f\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\f\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)
@flyinggorilla
Copy link
Author

I found the configuration setting and tried to change that, which didnt work either....

        idbClient = InfluxDBClient(url=configInfluxdb["url"], timeout=10, token=configInfluxdb['token'], org="x", debug=True)
        idbClient.api_client.configuration.verify_ssl = False
        idbClient.api_client.configuration.key_file = False

@bednar
Copy link
Contributor

bednar commented Jul 20, 2020

@flyinggorilla thanks for the issue, we will take a look

@bednar
Copy link
Contributor

bednar commented Jul 20, 2020

Hi @flyinggorilla,

The issue is fixed in 1.10.0 milestone.

If you would like to use a dev version then install client via:

pip install git+https://github.com/influxdata/influxdb-client-python.git@master

Regards

@flyinggorilla
Copy link
Author

Thanks, I can confirm the argument works in the dev build.
idbClient = InfluxDBClient(url=configInfluxdb["url"], timeout=10, token=configInfluxdb['token'], org="x.info", debug=True, verify_ssl=False)
idbWriter = idbClient.write_api(write_options=SYNCHRONOUS)
idbWriter.write(bucket="x/autogen", record=[point])

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

Successfully merging a pull request may close this issue.

2 participants