PyHive icon indicating copy to clipboard operation
PyHive copied to clipboard

connecting to HIVE secured with LDAP

Open JB-data opened this issue 3 years ago • 2 comments

Hi, I think previous posts showed that pyhive has issues connecting to an ldap secured cluster (https://github.com/dropbox/PyHive/issues/257). There was mention of a package to fix it (pure-transport by @devinstevenson ). However we failed to have success. The repo mentioned is about 2 years old. Is there any update on this? Does pyhive already support ldap in some way himself and is there a recent/detailed example available on how to do this?

When we connect from an outside server to the ldap secured hive instance (using a self-singed certificate), we get:

thriftpy.transport.TTransportException: TTransportException(type=1, message="Bad status: 3 (b'PLAIN auth failed: javax.security.sasl.AuthenticationException: Error validating LDAP user [Caused by javax.naming.CommunicationException: simple bind failed: aserver.local:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]]')")

This seems to be an error indicating that the machine from where we are connecting does not trust the certificate that the LDAP-secured cluster with hive is using. We failed to find a detailed description of what to do to fix this (it is often mentioned one shuold add the certificate to the truststore on the machine from where we are connecting).

Thanks for update!

JB-data avatar Apr 23 '21 10:04 JB-data

Hi,

I've been able to connect to LDAP using HTTPS using:

engine = create_engine('hive+https://username:password@localhost:10000/')

This is a new feature included on 0.6.4

dpgaspar avatar May 10 '21 11:05 dpgaspar

hello,i also meet this problem,did you solve it? bad status 3 (PLAIN auth failed Error validating LDAP user

shihaoLiua avatar Jan 27 '22 05:01 shihaoLiua