【发布时间】:2017-09-16 16:33:42
【问题描述】:
我不太熟悉证书的工作原理,所以我可能在做一些愚蠢的事情,提前道歉。
我正在尝试与 tableau 的 REST API 进行交互,并使用安全连接进行交互,因为他们的某些调用需要这样做。
但是,我在创建连接时遇到了各种错误。
我能够创建不安全的连接:
requests.get('https://tableau.mynetwork.lan', verify = False)
<Response [200]>
我还能够与 google 建立安全连接:
requests.get('https://google.com', verify = True)
<Response [200]>
但是,尝试创建与我的 tableau 服务器的安全连接:
requests.get('https://tableau.mynetwork.lan', verify = True)
或:
requests.get('https://tableau.mynetwork.lan', verify = certifi.old_where())
导致以下错误:
SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)
我的本地计算机上有我的 tableau 服务器证书,并尝试通过 cert 参数传递它们:
tableau_cert = r"C:\tabcert.cer"
requests.get('https://tableau.mynetwork.lan', cert=tableau_cert, verify = True)
但是得到这个错误:
Error: [('PEM routines', 'PEM_read_bio', 'no start line'), ('SSL routines', 'SSL_CTX_use_certificate_file', 'PEM lib')]
有人指点一下吗?
【问题讨论】:
标签: python rest ssl tableau-api