gpt4 book ai didi

python - 无法使用 TableauServerClient 连接到 tableau server 10.5

转载 作者:行者123 更新时间:2023-12-01 01:40:08 45 4
gpt4 key购买 nike

我使用以下 Python 代码连接到 Tableau 服务器:

import tableauserverclient as TSC
tableau_auth = TSC.TableauAuth('username', 'password')
server = TSC.Server('https://server_name.com/')
server.auth.sign_in(tableau_auth)

但我收到以下错误:

Traceback (most recent call last):  
File "C:\Program Files\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 444, in wrap_socket
cnx.do_handshake()
File "C:\Program Files\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1443, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "C:\Program Files\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1191, in _raise_ssl_error
_raise_current_error()
File "C:\Program Files\Anaconda3\lib\site-packages\OpenSSL\_util.py", line 48, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Program Files\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "C:\Program Files\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 849, in _validate_conn
conn.connect()
File "C:\Program Files\Anaconda3\lib\site-packages\urllib3\connection.py", line 356, in connect
ssl_context=context)
File "C:\Program Files\Anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 359, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Program Files\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 450, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Anaconda3\lib\site-packages\requests\adapters.py", line 445, in send
timeout=timeout
File "C:\Program Files\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Program Files\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='server_name.com', port=443): Max retries exceeded with url: //api/2.3/auth/signin (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Anaconda3\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 114, in wrapper
return func(self, *args, **kwargs)
File "C:\Program Files\Anaconda3\lib\site-packages\tableauserverclient\server\endpoint\auth_endpoint.py", line 30, in sign_in
**self.parent_srv.http_options)
File "C:\Program Files\Anaconda3\lib\site-packages\requests\sessions.py", line 559, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "C:\Program Files\Anaconda3\lib\site-packages\requests\sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "C:\Program Files\Anaconda3\lib\site-packages\requests\sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "C:\Program Files\Anaconda3\lib\site-packages\requests\adapters.py", line 511, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='server_name.com', port=443): Max retries exceeded with url: //api/2.3/auth/signin (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))

最佳答案

添加这行代码...

server.add_http_options({'verify': False})

关于python - 无法使用 TableauServerClient 连接到 tableau server 10.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51980383/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com