https service getting error while loading in map

975
17
Jump to solution
12-18-2018 10:10 AM
MRReddy
Occasional Contributor

below example works without error, but if i change the service to https from http then the error is appeared as some certification error(image below)

added proxy.ashx, proxy.config but still getting same certification error.

can we handle this in code or is it something related to server?

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>FeatureLayer</title>

    <link rel="stylesheet" href="https://js.arcgis.com/3.27/esri/css/esri.css">
    <script src="https://js.arcgis.com/3.27/"></script>

    <style>
        html, body, #map {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
    </style>

    <script>
require([
    "esri/map",
    "esri/layers/FeatureLayer",
    "dojo/domReady!"
  ],
  function(
    Map,
    FeatureLayer
  ) {

    var map = new Map("map", {
      basemap: "hybrid",
      center: [122.3321, 47.6062],
      zoom: 12
    });

    var featureLayer = new FeatureLayer("http://aaaaa.bbbbb.com/arcgis/rest/services/Maps/CityMap/MapServer/1");

    map.addLayer(featureLayer);

  });
    </script>
</head>

<body>
    <div id="map"></div>
</body>

</html>
0 Kudos
1 Solution

Accepted Solutions
BillFox
MVP Frequent Contributor

Hi Malla,

Chrome and Firefox have been very strict on this lately.

Issues similar to what I have seen involved getting a new SSL cert with required SAN reference included for TLS 1.2 and HSTS for Server, Portal, Web Adaptors..

And, applying the new TLS patches.

ArcGIS SSL/TLS Guidance Briefing has been updated 

(:=>)} Randall Williams

View solution in original post

17 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Does pasting the url you are using for that feature layer in the browsers address bar using http brinbg up the rest service end point or does it also produce an error?

0 Kudos
MRReddy
Occasional Contributor

Robert

in browser it appears as your connection is not secure, after clicking “proceed to begin” it loads service

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Malla,

   In your code change the other urls to http then:

<link rel="stylesheet" href="http://js.arcgis.com/3.27/esri/css/esri.css">
<script src="http://js.arcgis.com/3.27/"></script>

And be sure to bring up your app using http too.

0 Kudos
MRReddy
Occasional Contributor

tried with that it's not working

in URL I'm trying http://localhost:55481/HtmlPage.html  

when i paste the service in browser 

service is visible after going to advanced and clicking proceed to " "(unsafe)

and the search engine will be 

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

What web server are you using? Is it setup to only allow https?

0 Kudos
MRReddy
Occasional Contributor

IIS 7.0

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

What about the second part of my question?

0 Kudos
MRReddy
Occasional Contributor

it allows both http and https

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Malla,

   Port 55481 is not a standard port so are you using visual studio or visual studio code to do your js debugging?

0 Kudos