I got the same issue using ArcGIS server 10 SP2 Standard Java Edition. I resolved using the below code:
//add the legend
var legendDijit = new EsriLegend({
map: this.map
}, "legendDiv");
//issues with ArcGIS server 10 SP2 Standard Java Edition
if (window.location.protocol == 'https:') {
legendDijit._legendUrl = legendDijit._legendUrl.replace('http:', 'https:');
}
Hello,
I am having a similar issue. I am using the Javascript API and calling an ArcGIS map service in a Javascript/HTML application. The application is accessed via IE 11 and is in a locked down environment requiring everything over SSL.
All of the Javascript API libraries I call are https, the application is https, and the map services are https. When the map service is called, it fails due to the following network error:
SEC7111: HTTPS security is compromised by http://utility.arcgis.com/sharing/tools/legend?soapUrl=...
I have discovered that this is the way services published via an ArcGIS Server lower than v. 10 calls the legend service.
If I am unable to upgrade the GIS Server to 10, require accessing the application via IE, and must have everything in SSL, what are my options for working around this issue? As as note, I do not actually need to call the legend service for my application.
Thanks for the help!
Sara
Great, that works!
Hi, can you please explain more? the dojo.query part and then setting the image source path again. Is it because the image path might be losing that token information and need to be reappended?
Find the relevant images using dojo.query.Once found, modify their paths to include the proxy URL.HTH
Hi, can you please explain more? the dojo.query part
...and then setting the image source path again.
hi all, I have found this workaround in the meantime, I hope it works for you too.add it to the event onZoomEnd of your map. function onZoomEnd() { if (navigator.appName == 'Microsoft Internet Explorer') { timer = setTimeout(function () { var imgs = dojo.query('.esriLegendLayer > tbody > tr > td > img'); for(var i=0; i<imgs.length; i++){ imgs.src = "yourproxy" + imgs.src; } }, 100); } }
function onZoomEnd() { if (navigator.appName == 'Microsoft Internet Explorer') { timer = setTimeout(function () { var imgs = dojo.query('.esriLegendLayer > tbody > tr > td > img'); for(var i=0; i<imgs.length; i++){ imgs.src = "yourproxy" + imgs.src; } }, 100); } }
I was able to confirm Ben's findings that the error seems to be isolated to DynamicMapService layer swatches. The following defect has been logged for the request. [#NIM081725 Legend swatches for secure Dynamic Map Service layers are not returned in Internet Explorer only when application uses Identity Manager and is hosted on HTTPS. ]Please don't hesitate to contact Esri technical support to add your name to the list of customers requesting that the issue be resolved.
dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.AccordionContainer"); dojo.require("esri.map"); dojo.require("esri.dijit.Legend"); dojo.require("esri.arcgis.utils"); dojo.require("dijit.form.CheckBox"); dojo.require("esri.IdentityManager"); var map; var legendLayers = []; function init() { esri.config.defaults.io.proxyUrl = "proxy/proxy.ashx"; map = new esri.Map("map", { extent: new esri.geometry.Extent({"xmin":-12034010,"ymin":4487877,"xmax":-11965751,"ymax":4525561,"spatialReference":{"wkid":3857}}) }); //Add the terrain service to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service var basemap = new esri.layers.ArcGISTiledMapServiceLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"); map.addLayer(basemap); var trailsService = new esri.layers.ArcGISDynamicMapServiceLayer("https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/Trails/MapServer", { id: "Trails" }); /** // This will work. var conditions = new esri.layers.FeatureLayer("https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/TrailConditions/FeatureServer/0",{ id: "Conditions", mode: esri.layers.FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); **/ // This will fail. var layerURL = "https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/TrailConditions/MapServer"; var conditions = new esri.layers.ArcGISDynamicMapServiceLayer(layerURL); legendLayers.push({ layer: trailsService, title: 'Trails' }); legendLayers.push({ layer: conditions, title: 'Conditions' }); dojo.connect(map,'onLayersAddResult',function(results){ console.log("layers add result: ", results, legendLayers); var legend = new esri.dijit.Legend({ map: map, layerInfos: legendLayers },"legendDiv"); legend.startup(); }); map.addLayers([trailsService, conditions]); dojo.connect(map, 'onLayersAddResult', function(results) { //add check boxes dojo.forEach(legendLayers, function(layer){ var layerName = layer.title; var checkBox = new dijit.form.CheckBox({ name: "checkBox" + layer.layer.id, value: layer.layer.id, checked: layer.layer.visible, onChange: function(evt) { var clayer = map.getLayer(this.value); clayer.setVisibility(!clayer.visible); this.checked = clayer.visible; } }); //add the check box and label to the toc dojo.place(checkBox.domNode,dojo.byId("toggle"),"after"); var checkLabel = dojo.create('label',{'for':checkBox.name, innerHTML:layerName},checkBox.domNode,"after"); dojo.place("<br />",checkLabel,"after"); }); }); dojo.connect(map, 'onLoad', function(theMap) { //resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', map,map.resize); }); } dojo.addOnLoad(init);
Thanks for clarifying. I'm still waiting to hear back about testing this with a JSP proxy on a AGS Java instance + SSL.
The error we are seeing is in the default legend widget using the identity manager.
That circumvents the purpose of using the Identity Manager. Is that what you're doing in your app?
https://www.mymanatee.org/arcgis/rest/services/utilities-infrastructure/irrigation/MapServer/?token=UbUqrFQqf4LxwkwbMzefuTVv47Hfu_3vVxXBP5iykzI.not sure how long that token is good for.
Thanks Jeff. That URL redirects to what looks like a resource on your local network and 404's for me. Here's the redirect URL I'm seeing: https://mcg-ap-arcsvr02.mcgad.local:8343/arcgis/rest/login?redirect=https%3A%2F%2Fwww.mymanatee.org%2Farcgis%2Frest%2Fservices%2Futilities-infrastructure%2Firrigation%2FMapServer%2F
Let me see what I can do...might take a bit of searching to find a Java instance configured with SSL and appropriate services.
Would be beneficial if esri could test against proxy.jsp and a JAVA base install.
I also am using a .jsp proxy and have ArcGIS Server for JAVA 10ps4
Jeff�?? are you on 2.8 as well?
Just to pile on, i can replicate this as well. On my secure service (entire app is secure, so layers are not), the legend shows red x's in IE onlyThe non base64 encoding is definitely the difference.The source path to the image in the legend is not getting the token appended on it If i sniff the token using fiddler, and then append the ?token=LqGIFsRUz8nkeM3XKjYT4W1U0xfLvBT7cEkYZcT3jZU. to the end of the image request in IE for the legend the legend item appears.
It appears that I am using Base64, as the requests for my images in Internet Explorer look like: https://www.efafrica.com/rest/services/EFAv3/EFA_Mainv3/MapServer/1/images/3b55578fHow do I force the actual image request rather that the Base64?
Coincidentally, once I have right-clicked on the red x image and copied the image URL then logged in through the ArcGIS Server REST API Login screen that one image appears in the legend but none of the others, would you expect this to happen? I feel we are getting a little closer to solving the problem<snip>
How's this look: https://servicesbeta.esri.com/demos/https/legend_id_manager_https.html
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.