mapbox static image export fails with tile server requiring client certificates
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
Hello,
I am using plotly.py on an internal network which does not have Internet connectivity. All connections on this network require client certificates, all servers have signed certificates for which we have a Certificate Authority bundle to verify those certificates.
I can create mapbox maps in our Jupyter environment which render appropriately, but when I try to export the map as an image using Kaleido I receive a chain of errors, concluding with error: ValueError: Transform failed with error code 525: Mapbox error. which references kaleido/scopes/plotly.py (here)
The HTTP 525 code is "SSL Handshake Failure". I'm using a 'white-bg' mapbox style and have confirmed no requests are going out looking for a mapbox server. When I remove the map tiles from the chart figure I can successfully export the map as a static image. Digging through the plotly code, it looks like the Kaleido base scope (here) is using chromium to render the map and then save it as an image.
The issue is that when I render the map in my browser, the browser has my client certificates loaded and the CA bundle loaded and it brings in the image tiles. When Plotly/Kaleido tries to retrieve the tiles using the underlying headless chromium, it's using a bare GET request and is being denied by the server (HTTP 525).
I've spent a lot of time looking for flags that could be passed to chromium to tell it to use my client certificates and the CA bundle, but (VERY surprisingly) there do not appear to be any.
A reproducible example is exactly like the Mapbox Map Layers - Base Tiles from the USGS: no token needed example, except that the server would require client certificates and could be verified with a custom CA bundle.
I would happily use a work-around if one was possible. Thanks!
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、クライアント証明書を必要とするネットワーク上で、リンクされている USGS base-tiles の例を使用して Mapbox static export の失敗を再現します。kaleido/scopes/plotly.py と kaleido/scopes/base.py を読み、その後、クライアント証明書と CA bundle を使って headless Chromium がタイルを読み込めるようにする方法を特定します。これらのタイルを使ってチャートが正常にエクスポートできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100