Esri leaflet callback returns http not https

2201
8
06-07-2017 02:08 PM
Labels (1)
GeoffreyJoseph
Occasional Contributor

* Browser and version:

Chrome: Version 58.0.3029.110 (64-bit)

* Version of Leaflet (`L.version`):

0.7.7

* Version of esri Leaflet (`L.esri.VERSION`):

1.0.5

Steps to reproduce the error:
url: https://argis.ualr.edu/DCFS/index.html

1. load the url, at first it is secured, then it becomes unsecured? when the map is loaded
2. check out the console

What happens is .

When I load a layer from my server 'https' the proxy returns the following, the window._EsriLeafletCallbacks.c0 returns 'http'

 

```

// 20170607154733
// https://argis.ualr.edu/DotNet/proxy.ashx?https://argis.ualr.edu/arcgis/rest/services/DF/MapServer/ex...

window._EsriLeafletCallbacks.c0({
"href": "http://argis.ualr.edu/arcgis/rest/directories/arcgisoutput/DF_MapServer/_ags_map1fcce4121c054f088080...",
"width": 1920,
"height": 974,
"extent": {
"xmin": -10865064.948568091,
"ymin": 3830412.3614267511,
"xmax": -9690992.194107784,
"ymax": 4426009.6858248441,
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
}
},
"scale": 2311162.2171551138
});

```

 

Apologize couldn't figure out how to format the code.

0 Kudos
8 Replies
JohnGravois
Deactivated User

neither esri leaflet, the proxy, nor the JSONP callback parameter are the cause of the problem you're seeing.

https://argis.ualr.edu/arcgis/rest/services/DF/MapServer/export?bbox=-10865064.948568093%2C3830412.3... 

as i mentioned in the issue below (which you already replied to), some misconfiguration of ArcGIS Server is causing it to return `https` urls in its map service export operation JSON payloads instead of preserving the protocol of the initial request.

https://github.com/Esri/esri-leaflet/issues/955#issuecomment-307445374 

were you able to workaround the problem by asking for a raw image?

0 Kudos
GeoffreyJoseph
Occasional Contributor

No I wasn't able to resolve it with the workaround, reached out to the guy in the thread you are referencing, but no luck.

If it is the server config, any idea of things should I look for? I do not do the server admin but I can pass along any suggestions.
On a related note... On the same server I have a L.markerClusterGroup layer that does not cause the mixed content warning. Strange...
0 Kudos
JohnGravois
Deactivated User

what happens exactly when you set f:'image' in the dynamicMapLayer constructor?

either way I'll reach out to a few other Esri folks to see if they can help us configure the service to return https urls

0 Kudos
GeoffreyJoseph
Occasional Contributor

Same thing essentially. Everything looks good until the image is requested, then I get the warning about insecure content.

I have set up a test here...

https://argis.ualr.edu/sectest/ 

0 Kudos
JohnGravois
Deactivated User

sorry about that. i forgot that specifying a proxy overrides that option...

https://github.com/Esri/esri-leaflet/blob/v1.0.5/src/Layers/DynamicMapLayer.js#L17 

why exactly are you proxying a service thats visible publicly? is this just a repro case to demonstrate the problem you're seeing with a different secure service?

0 Kudos
GeoffreyJoseph
Occasional Contributor

Yes it is a repro, the issue is actually arising on a secure service that is not visible

0 Kudos
JohnGravois
Deactivated User

i'm a bit out of my depth here, but internal research has pointed me to something that seems relevant.

"WebContextURL" in the ArcGIS Server Admin API should allow for forcing href urls to match whatever is specified there. One caveat is that the server will apply the webContextUrl only if it determines the request to be made via a proxy since such requests have X-FORWARDED-FOR or X-FORWARDED-HOST request headers.

In one case I found, a customer decided to bypass their web adaptor entirely and point a load balancer directly at the GIS Server on port 6080 to resolve the problem.

to be frank, ArcGIS Server architectures can get pretty gnarly and I'm just pointing you at a little doc and regurgitating internal notes. i'd highly recommend logging your own support call and referencing the rejected bug NIM091395 in order to receive assistance from someone on our team in diagnosing where your own problem lies.

0 Kudos
GeoffreyJoseph
Occasional Contributor

Thank you very much for your research and pointing me in the right

direction. I will open a ticket with ESRI and post any solutions that arise.

0 Kudos