Stamen maps with SSL

Hi all,

For the project I’m doing I’m using maps from Stamen. I noticed however that they, as used in Bokeh, do not work with a SSL configuration. Long story short, I changed the following lines in tile_providers.py

_SERVICE_URLS = dict(
    CARTODBPOSITRON='https://tiles.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
    CARTODBPOSITRON_RETINA='https://tiles.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png',
    STAMEN_TERRAIN='http://tile.stamen.com/terrain/{Z}/{X}/{Y}.png',
    STAMEN_TERRAIN_RETINA='http://tile.stamen.com/terrain/{Z}/{X}/{Y}@2x.png',
    STAMEN_TONER='http://tile.stamen.com/toner/{Z}/{X}/{Y}.png',
    STAMEN_TONER_BACKGROUND='http://tile.stamen.com/toner-background/{Z}/{X}/{Y}.png',
    STAMEN_TONER_LABELS='http://tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png',
    OSM='https://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png',
    WIKIMEDIA='https://maps.wikimedia.org/osm-intl/{Z}/{X}/{Y}@2x.png',
    ESRI_IMAGERY='https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{Z}/{Y}/{X}.jpg'
)

to

_SERVICE_URLS = dict(
    CARTODBPOSITRON='https://tiles.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
    CARTODBPOSITRON_RETINA='https://tiles.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png',
    STAMEN_TERRAIN='https://stamen-tiles.a.ssl.fastly.net/terrain/{Z}/{X}/{Y}.png',
    STAMEN_TERRAIN_RETINA='https://stamen-tiles.a.ssl.fastly.net/terrain/{Z}/{X}/{Y}@2x.png',
    STAMEN_TONER='https://stamen-tiles.a.ssl.fastly.net/toner/{Z}/{X}/{Y}.png',
    STAMEN_TONER_BACKGROUND='https://stamen-tiles.a.ssl.fastly.net/toner-background/{Z}/{X}/{Y}.png',
    STAMEN_TONER_LABELS='https://stamen-tiles.a.ssl.fastly.net/toner-labels/{Z}/{X}/{Y}.png',
    OSM='https://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png',
    WIKIMEDIA='https://maps.wikimedia.org/osm-intl/{Z}/{X}/{Y}@2x.png',
    ESRI_IMAGERY='https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{Z}/{Y}/{X}.jpg'
)

i.e., I changed http://tile.stamen.com to https://stamen-tiles.a.ssl.fastly.net. At least for my case (STAMEN_TERRAIN) it works. I got the new URLs from the Stamen website, http://maps.stamen.com/#toner/12/37.7706/-122.3782

@sebacastroh IIRC the stamen URLs are “http” because at some point several years ago when those were added, “http” was the only option available. If there are reliable “https” URLs now, then I see no reason not to update things. (Would need to check that all the URLs work with https) Can you file a GH issue about this? (And, ideally, if you are up for it, a PR to make the change).

Thanks!