grafcli icon indicating copy to clipboard operation
grafcli copied to clipboard

Grafcli crashes with self-signed SSL certificates

Open wolfig opened this issue 9 months ago • 0 comments

Hi Grafcli-Experts,

I am trying to export a bunch of dashboards from a server, where I created self-signed SSL cerificates. When trying to run grafcli

grafcli ls remote/my_server I get an SSLError:

File "/opt/python-3.9.19/bin/grafcli", line 27, in sys.exit(main()) File "/opt/python-3.9.19/bin/grafcli", line 13, in main result = cli.execute(*sys.argv[1:]) File "/opt/python-3.9.19/lib/python3.9/site-packages/climb/core.py", line 79, in execute return self._commands.execute(command, **kwargs) File "/opt/python-3.9.19/lib/python3.9/site-packages/climb/commands.py", line 26, in execute return method(*args, **kwargs) File "/opt/python-3.9.19/lib/python3.9/site-packages/grafcli/commands.py", line 30, in ls result = self._resources.list(path) File "/opt/python-3.9.19/lib/python3.9/site-packages/grafcli/resources/resources.py", line 38, in list return manager.list(*parts) File "/opt/python-3.9.19/lib/python3.9/site-packages/grafcli/resources/common.py", line 11, in list return self._storage.list() File "/opt/python-3.9.19/lib/python3.9/site-packages/grafcli/storage/api.py", line 35, in list for row in self._call('GET', 'search')] File "/opt/python-3.9.19/lib/python3.9/site-packages/grafcli/storage/api.py", line 26, in _call response = requests.request(method, full_url, File "/opt/python-3.9.19/lib/python3.9/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "/opt/python-3.9.19/lib/python3.9/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/opt/python-3.9.19/lib/python3.9/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/opt/python-3.9.19/lib/python3.9/site-packages/requests/adapters.py", line 517, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='lxyrpc01.gsi.de', port=3000): Max retries exceeded with url: /api/search (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1133)')))`

I think in grafcli/storage/api, a "verify = on/off" attribute should be passed from the grafcli.conf. Or this feature already implemented, then it would be nicht to have an example for self-signed certificates in the documentation.

wolfig avatar May 07 '24 08:05 wolfig