Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host name doesn't match when using LDAP and ca_cert #295

Open
perfectspr opened this issue Mar 22, 2018 · 2 comments · May be fixed by #296
Open

host name doesn't match when using LDAP and ca_cert #295

perfectspr opened this issue Mar 22, 2018 · 2 comments · May be fixed by #296

Comments

@perfectspr
Copy link

conn = connect(host=example.com', port=21050, database=‘default’, auth_mechanism='LDAP', user=‘xxxxx’, password=‘xxxxx’, use_ssl=True, ca_cert='truststore.pem')          

Log:

Traceback (most recent call last):                                                        
  File "impyla_test.py", line 2, in <module>                                              
    conn = connect(host=‘example.com', port=21050, database=‘default’, auth_mechanism='LDAP', user=‘xxxxx’, password=‘xxxxx’, use_ssl=True, ca_cert='truststore.pem')          
  File "/usr/local/anaconda3/envs/acs/lib/python3.5/site-packages/impala/dbapi.py", line 147, in connect                                                                             
    auth_mechanism=auth_mechanism)                                                        
  File "/usr/local/anaconda3/envs/acs/lib/python3.5/site-packages/impala/hiveserver2.py", line 758, in connect                                                                       
    transport.open()                         
  File "/usr/local/anaconda3/envs/acs/lib/python3.5/site-packages/thrift_sasl/__init__.py", line 61, in open                                                                         
    self._trans.open()                                                                    : " + CONNECTION_URL);                                                                     
  File "/usr/local/anaconda3/envs/acs/lib/python3.5/site-packages/thriftpy/transport/socket.py", line 96, in open                                                                    
    self.sock.connect(addr)                                                               
  File "/usr/local/anaconda3/envs/acs/lib/python3.5/ssl.py", line 1027, in connect        
    self._real_connect(addr, False)           
  File "/usr/local/anaconda3/envs/acs/lib/python3.5/ssl.py", line 1018, in _real_connect   
    self.do_handshake()                      
  File "/usr/local/anaconda3/envs/acs/lib/python3.5/ssl.py", line 996, in do_handshake    
    self._sslobj.do_handshake()                                                           
  File "/usr/local/anaconda3/envs/acs/lib/python3.5/ssl.py", line 646, in do_handshake     
    match_hostname(self.getpeercert(), self.server_hostname)                               
  File "/usr/local/anaconda3/envs/acs/lib/python3.5/ssl.py", line 309, in match_hostname  
    % (hostname, dnsnames[0]))                                                             
ssl.CertificateError: hostname ‘example.com' doesn't match ‘example1.com'    
@perfectspr
Copy link
Author

perfectspr commented Mar 22, 2018

Should provide an option to disable hostname verification for SSL connection

@prasanna-sk
Copy link
Contributor

Hi - I am facing the same issue - Hostname we connected to <> doesn't match certificate provided commonName.

We use the same certificate for impala-shell and it works fine, tableau connection (with Allow for common Name mismatch - checked) and it works fine too.

Is there a patch/fix to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants