plotly / plotly/plotly.py

mapbox static image export fails with tile server requiring client certificates

Ouverte
#3,339 3 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

bug P3
Langage dominant
Python
Étoiles
18.8k
Forks
2.8k
Merge moyen
16 h 26 min
PR mergées (30 j)
21

Description

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!

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par reproduire l’échec de l’exportation statique Mapbox à l’aide de l’exemple USGS base-tiles lié, sur un réseau nécessitant des certificats client. Lisez kaleido/scopes/plotly.py et kaleido/scopes/base.py, puis déterminez ce qui permettrait à Chromium headless de charger les tuiles avec le certificat client et le bundle CA ; le travail est terminé lorsque le graphique est exporté avec succès avec ces tuiles.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
data-visualization
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.