I'm attempting to narrow down issues I'm having pulling a map server layer into my Android project.
I'm trying to pull in a map layer from a dev server and place it on top of an ESRI basemap layer. So far I have had no luck with pulling in the map server layer. The URL for the layer (without identifiable information) is https://xxxxx-dev.xxxxxxx.net:6400/arcgis/rest/services/..../MapServer.
I do know these things;
1) My code will pull in an ESRI public map server layer and place it over a base map layer.
2) The URL for the map server I want to pull from makes me "Accept the Risk and Continue" when I look at it through a web browser. The URL uses an invalid security certificate.
3) I don't have the authority to change or update that certificate. This layer is just for dev work though and will not be used in the final product.
I don't know these things;
1) Is the invalid security certificate causing the layer to not render?
2) Is there a way to configure network setting inside the app so that I can continue with development?
3) Am I barking up the wrong tree on this?
Any help would be appreciated
Solved! Go to Solution.
Appreciate the response. I'll take a look at this see what I can do.
Additional info is that this map server I trying to pull from is an ArcGIS server configured with a self-signed certificate. It's communicating through the default 6443 port.
Anyone have an opinion or idea regarding this?
Hello @klebercj ,
It seems that the dev server you are trying to use is self-signed and the connection is being refused.
You have a couple options:
1. Install the root certificate in your device so that the device automatically trusts the dev server you are trying to access.
- To verify that this was done correctly, try going to the dev server using your mobile browser and you won't get the ""Accept the Risk and Continue" message anymore.
2. Create a NetworkAuthenticationChallengeHandler that returns a ServerTrust network credential when the NetworkAuthenticationType is of type ServerTrust.
- Warnign: This will trust all self-signed server certificates and should only be used in test environments and NOT for production.
override suspend fun handleNetworkAuthenticationChallenge(challenge: NetworkAuthenticationChallenge): NetworkAuthenticationChallengeResponse {
return when (challenge.networkAuthenticationType) {
...
is NetworkAuthenticationType.ServerTrust ->
NetworkAuthenticationChallengeResponse.ContinueWithCredential(ServerTrust)
}
...
}
}
Appreciate the response. I'll take a look at this see what I can do.