How to disable portal SSL checks completely?

556
3
08-10-2022 03:21 AM
VineetMenon
New Contributor II

Hi,

I have an enterprise server (portal + server) running at my premises with a self signed certificate. I'm trying to get arcgis java runtime to publish a feature to a feature layer. I'm having a hard time getting the token authentication to work for me.

The following is the code for setting up an AuthenticationHandler.

AuthenticationManager.setAuthenticationChallengeHandler((AuthenticationChallenge arg0) -> {
    logger.error("auth challenge {}, {}", arg0, arg0.getType());
    return new AuthenticationChallengeResponse(
       AuthenticationChallengeResponse.Action.CONTINUE_WITH_CREDENTIAL,
       new UserCredential("<username>", "<password>"));
   });
AuthenticationManager.setTrustAllSigners(true);
AuthenticationManager.setSelfSignedCertificateListener((arg0, arg1) -> {
    return new SelfSignedResponse(true, true);
});

Even after being so permissive, I'm getting an exception "javax.net.ssl.SSLPeerUnverifiedException: Certificate for <gisportal1.<domain>.in> doesn't match common name of the certificate subject: portal1".

Evidently, there's a mismatch in the certificate CN and the url. Can I skip this check (for now) and let the DevOps deal with it later?

Tags (3)
0 Kudos
3 Replies
MarkBaird
Esri Regular Contributor

Hi

It's hard to comment on this without trying it out.  Is there any way you can share access to your server and the credentials.  I appreciate you won't want to share this on a public forum, but there is a private message system here you can use to share these with me.

If it's not possible, we'll try to make suggestions.

Can you also tell me what version of the SDK you are using?  This is a key piece of information.

Thanks

Mark

0 Kudos
VineetMenon
New Contributor II

Hi Mark,

Extremely sorry, but the server isn't available publicly. It's hosted on a private network. 

BTW, I changed the certificate assigned to tomcat instance that was hosting the web adapter to properly match the hostname and now I'm not getting this particular error.

 

Thanks for the help.

0 Kudos
MarkBaird
Esri Regular Contributor

Excellent - glad you've got a working solution.

 

Mark

0 Kudos