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?