Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Error while enabling the Kerberos with AD.


Hello All,

I have been trying to enable kerberos with AD in Ambari. Imported AD CA certificate into ambari truststore and restarted the ambari server.

But it turned to be error which shows as follows.


Failed to communicate with the Active Directory at ldaps://<IP_ADDR>:636: <IP_ADDR>:636

javax.naming.CommunicationException: <IP_ADDR>:636 [Root exception is No subject alternative DNS name matching found.] at com.sun.jndi.ldap.Connection.<init>( at com.sun.jndi.ldap.LdapClient.<init>( at com.sun.jndi.ldap.LdapClient.getInstance( at com.sun.jndi.ldap.LdapCtx.connect( at com.sun.jndi.ldap.LdapCtx.<init>( at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL( at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs( at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance( at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext( at javax.naming.spi.NamingManager.getInitialContext( at javax.naming.InitialContext.getDefaultInitCtx( at javax.naming.InitialContext.init( at javax.naming.ldap.InitialLdapContext.<init>( at org.apache.ambari.server.serveraction.kerberos.ADKerberosOperationHandler.createInitialLdapContext( at org.apache.ambari.server.serveraction.kerberos.ADKerberosOperationHandler.createLdapContext( at at org.apache.ambari.server.controller.KerberosHelperImpl.validateKDCCredentials( at org.apache.ambari.server.controller.KerberosHelperImpl.handleTestIdentity( at org.apache.ambari.server.controller.KerberosHelperImpl.createTestIdentity( at org.apache.ambari.server.controller.AmbariManagementControllerImpl.createAction( at org.apache.ambari.server.controller.internal.RequestResourceProvider$1.invoke( at org.apache.ambari.server.controller.internal.RequestResourceProvider$1.invoke( at org.apache.ambari.server.controller.internal.AbstractResourceProvider.invokeWithRetry(AbstractResourceP.


Caused by: No subject alternative DNS name matching <IP_ADDR>found. at at at at at at at at at at at at at com.sun.jndi.ldap.Connection.createSocket( at com.sun.jndi.ldap.Connection.<init>( ... 116 more Caused by: No subject alternative DNS name matching found. at at at at at at at

ERROR [ambari-client-thread-42] KerberosHelperImpl:2232 - Cannot validate credentials: org.apache.ambari.server.serveraction.kerberos.KerberosInvalidConfigurationException: Failed to connect to KDC - Failed to communicate with the Active Directory at ldaps://<IP_ADDR>:636: <IP_ADDR>:636 Make sure the server's SSL certificate or CA certificates have been imported into Ambari's truststore. 25 Aug 2018 07:40:41,298 ERROR [ambari-client-thread-42] BaseManagementHandler:67 - Bad request received: Failed to connect to KDC - Failed to communicate with the Active Directory at ldaps://<IP_ADDR>:636: <IP_ADDR>:636

Even i tried to test the connection from ambari host to AD using following:

LDAPTLS_CACERT=ad1.cer ldapsearch -H ldaps://<IP_ADDR>:636 -D "" -b "OU=hdfedge,DC=Hadoop,DC=Internal" "(&(objectclass=person)(sAMAccountName=*))"

but it is giving the below error.

ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

If anyone faced the same problem please correct me the right direction.


New Contributor

Looks like you need to add CA certificate into your java keystore.


Hi @Shivam Dwivedi,

After your suggestion, i above problem got resolved. Even i added the windows AD hostname (not the aws internal private DNS) to /etc/hosts in my cluster.


Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.