Created 10-06-2015 08:33 PM
In the Usync Log we are getting "Unable to find the valid certification path"
Documentation does not have anything on LDAP SSL and ranger.
Ambari and LDAP ssl is working...screen-shot-2015-10-06-at-42559-pm.png
Tried to put the java cacerts as the usersync.trustore file as the LDP cert is in java cacerts.
This does not work.
What is the exact detail process to get LDAP SSL working for Ranger Usync
Created 10-06-2015 11:41 PM
Option 1: For Self Signed Certs in your own TrustStore
keytool -import -trustcacerts -alias MyLdap -file cert.pem -keystore /etc/pki/java/cacerts
cd /usr/hdp/<version>/ranger-usersync service ranger-usersync stop service ranger-usersync start
Option 2: For Self Signed Certs Using Default Ranger UserSync TrustStore
cp /etc/pki/java/cacerts /usr/hdp/<current>/ranger-usersync/userSyncCAcerts keytool -import -trustcacerts -alias MyLdap -file cert.pem -keystore /usr/hdp/2<current>/ranger-usersync/userSyncCAcerts (where cert.pem has the the LDAPS cert)
Option 3: Using Certificate Authority Signed Cert in Default Java Store
Update - Possible Solution to Manual Restarts of Ranger with Self Signed Cert not in ${JAVA_HOME}/jre/lib/security/cacerts:
For Ranger Usersync
Edit /usr/hdp/current/ranger-usersync/ranger-usersync-services.sh Add java option > -Djavax.net.ssl.trustStore=/<path to the cacert>
For Ranger Admin
Edit /usr/hdp/current/ranger-admin/ews/ranger-admin-services.sh Add parameter -Djavax.net.ssl.trustStore=<path to the cacerts> to the java call in the script.
Created 10-06-2015 11:41 PM
Option 1: For Self Signed Certs in your own TrustStore
keytool -import -trustcacerts -alias MyLdap -file cert.pem -keystore /etc/pki/java/cacerts
cd /usr/hdp/<version>/ranger-usersync service ranger-usersync stop service ranger-usersync start
Option 2: For Self Signed Certs Using Default Ranger UserSync TrustStore
cp /etc/pki/java/cacerts /usr/hdp/<current>/ranger-usersync/userSyncCAcerts keytool -import -trustcacerts -alias MyLdap -file cert.pem -keystore /usr/hdp/2<current>/ranger-usersync/userSyncCAcerts (where cert.pem has the the LDAPS cert)
Option 3: Using Certificate Authority Signed Cert in Default Java Store
Update - Possible Solution to Manual Restarts of Ranger with Self Signed Cert not in ${JAVA_HOME}/jre/lib/security/cacerts:
For Ranger Usersync
Edit /usr/hdp/current/ranger-usersync/ranger-usersync-services.sh Add java option > -Djavax.net.ssl.trustStore=/<path to the cacert>
For Ranger Admin
Edit /usr/hdp/current/ranger-admin/ews/ranger-admin-services.sh Add parameter -Djavax.net.ssl.trustStore=<path to the cacerts> to the java call in the script.
Created 10-30-2015 01:29 AM
thank you, good information.
Created 11-04-2015 12:10 AM
seem this step is necessary even for self-signed certs.
Created 07-15-2016 10:20 AM
Option 2 didn't work for me.
It is throwing me a message that "Certificate already exists" . I am still getting SSL Handshake Exception for ranger usersync.
Which option worked for you?
Created 12-18-2018 12:53 PM
I'm getting the following error after following "Option #2". My Ranger is not TLS/SSL enabled. Please help
18 Dec 2018 12:17:23 INFO LdapPolicyMgrUserGroupBuilder [UnixUserSyncThread] - Using principal = rangerusersync/stg-agent001-stg-cloud009.XXXXX.nm2@XXXXXX.COM and keytab = /etc/security/keytabs/rangerusersync.service.keytab 18 Dec 2018 12:17:24 ERROR LdapPolicyMgrUserGroupBuilder [UnixUserSyncThread] - Failed to build Group List : com.sun.jersey.api.client.UniformInterfaceException: POST http://stg-agent001-stg-cloud009.xxxxx.nm2:6080/service/xusers/groups/ returned a response status of 404 Not Found
and
18 Dec 2018 12:17:24 INFO LdapDeltaUserGroupBuilder [UnixUserSyncThread] - LdapDeltaUserGroupBuilder.getUsers() completed with user count: 0 18 Dec 2018 12:17:24 ERROR LdapPolicyMgrUserGroupBuilder [UnixUserSyncThread] - Failed to add User : com.sun.jersey.api.client.UniformInterfaceException: POST http://stg-agent001-stg-cloud009.xxxxx.nm2:6080/service/xusers/ugsync/auditinfo/ returned a response status of 404 Not Found
Created 10-31-2015 08:24 AM
As long as LDAP server's certificate is imported into the truststore used by usersync process, you need not have to edit the scripts or manually restart the services. Restarting from Ambari should just work.
Created 03-14-2016 04:23 PM
Created 11-20-2017 05:32 PM
Be careful with the first option above.
In modern RedHat o CentOS systems you should not manually edit the /etc/pki/java/cacerts file. In fact it is a symbolic link part of the consolidated CA certificates system and its content is handled by the update-ca-trust tools.
Please refer to the update-ca-trust(8) manual page for additional information
# ll cacerts lrwxrwxrwx 1 root root 40 Sep 22 12:06 cacerts -> /etc/pki/ca-trust/extracted/java/cacerts