2017-09-16 22 views
1

私は、certsのしくみに過度に精通しているわけではないので、私は恐らく何かばかげて、前もって謝罪しています。Python Requests Tableau REST API SSLエラー

私は、いくつかの呼び出しでこれを必要とするため、安全な接続を使用してtableauのrest APIとやりとりしようとしています。

しかし、さまざまなエラーが発生して接続が作成されています。私のタブローとの安全な接続を作成しようと、しかし

requests.get('https://google.com', verify = True) 
<Response [200]> 

:私はまた、Googleとの安全な接続を作成することができています

requests.get('https://tableau.mynetwork.lan', verify = False) 
<Response [200]> 

:私は安全でない接続を作成することができています

サーバ:

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 = 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')] 

誰もがポインタを持っていますか?

答えて

1

I have my tableau server certs on my local machine, and have attempted to pass them via the cert parameter:

requests.get('https://tableau.mynetwork.lan', cert=tableau_cert, verify = True) 

certは、CAを指定するための間違ったパラメータです。正しい方法according to the documentationverifyパラメータの値としてごCAファイルへのパスを設定することです:

requests.get('https://tableau.mynetwork.lan', verify=tableau_cert) 

また、あなたが持っているファイルが正しくPEM encodedであることを確認してください。

関連する問題