I am trying to use the dremio_client command to issue a SQL command to the Dremio server. However, I am getting a client side certificate verification error even when I use the --skip-verify argument
First, I installed dremio-client using the pip3 command like this:
$ pip3 install dremio-client
Then I attempted to run the following command:
$ dremio_client --ssl --skip-verify --hostname dremio.org --port 443 --username <MY USERID> --password '<MY PASSWORD>' query --sql 'select * from sys.options'
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/dremio_client/auth/__init__.py", line 41, in auth
return _existing_token(config_dict)
File "/usr/local/lib/python3.7/site-packages/dremio_client/auth/__init__.py", line 76, in _existing_token
raise KeyError
KeyError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 360, in connect
ssl_context=context,
File "/usr/local/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 423, in wrap_socket
session=session
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 870, in _create
self.do_handshake()
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='dremio.org', port=443): Max retries exceeded with url: /apiv2/login (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/dremio_client", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/dremio_client/cli.py", line 107, in query
base_url, token = get_base_url_token(args)
File "/usr/local/lib/python3.7/site-packages/dremio_client/conf/cli_helper.py", line 36, in get_base_url_token
token = auth(base_url, config)
File "/usr/local/lib/python3.7/site-packages/dremio_client/auth/__init__.py", line 44, in auth
token = config_auth(base_url, config_dict)
File "/usr/local/lib/python3.7/site-packages/dremio_client/auth/config.py", line 52, in login
return _login(base_url, username, password, timeout, verify)
File "/usr/local/lib/python3.7/site-packages/dremio_client/auth/basic.py", line 40, in login
r = requests.post(url, json={"userName": username, "password": password}, timeout=timeout, verify=verify)
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='dremio.org', port=443): Max retries exceeded with url: /apiv2/login (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))
I also tried placing the configuration in the file: ~/.config/dremio_client/config.yaml but I experienced the same error.
$ cat ~/.config/dremio_client/config.yaml
auth:
type: basic # currently only basic is supported
username: [email protected]
password: ********
timeout: 10
hostname: dremio.org
port: 443
ssl: true
skip-verify: true