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

0.8.6 - ldap error: hostname does not match the server certificate #251

Open
patrick99e99 opened this issue Jun 21, 2018 · 4 comments
Open

Comments

@patrick99e99
Copy link

patrick99e99 commented Jun 21, 2018

When I use 0.8.5, if I try to authenticate I see:

irb(main):002:0> u.valid_ldap_authentication?('foobar')
  LDAP: LDAP dn lookup: uid=patrick
  LDAP: LDAP search for login: uid=patrick
  LDAP: LDAP search yielded 1 matches
  LDAP: Authorizing user uid=PCollins,object=orgperson,dv=so_runner,dv=syncobjectcatalog
  LDAP: Not authorized because not authenticated.

But then when I upgrade to 0.8.6, I now get:

irb(main):002:0> u.valid_ldap_authentication?('foobar')
  LDAP: LDAP dn lookup: uid=patrick
  LDAP: LDAP search for login: uid=patrick
Traceback (most recent call last):
       16: from (irb):2
       15: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/devise_ldap_authenticatable-0.8.6/lib/devise_ldap_authenticatable/model.rb:48:in `valid_ldap_authentication?'
       14: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/devise_ldap_authenticatable-0.8.6/lib/devise_ldap_authenticatable/ldap/adapter.rb:15:in `valid_credentials?'
       13: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/devise_ldap_authenticatable-0.8.6/lib/devise_ldap_authenticatable/ldap/connection.rb:97:in `authorized?'
       12: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/devise_ldap_authenticatable-0.8.6/lib/devise_ldap_authenticatable/ldap/connection.rb:51:in `dn'
       11: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/devise_ldap_authenticatable-0.8.6/lib/devise_ldap_authenticatable/ldap/connection.rb:239:in `search_for_login'
       10: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap.rb:775:in `search'
        9: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap.rb:1273:in `paged_searches_supported?'
        8: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap.rb:1207:in `search_root_dse'
        7: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap.rb:782:in `search'
        6: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap/instrumentation.rb:19:in `instrument'
        5: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap.rb:783:in `block in search'
        4: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap.rb:1300:in `use_connection'
        3: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap.rb:1321:in `new_connection'
        2: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap/connection.rb:698:in `socket'
        1: from /srv/www/myapp/shared/vendor/bundle/ruby/2.5.0/gems/net-ldap-0.16.1/lib/net/ldap/connection.rb:72:in `open_connection'
Net::LDAP::Error (hostname "10.255.5.15" does not match the server certificate)

What can I do to resolve this?

@xtrasimplicity
Copy link

xtrasimplicity commented Jul 2, 2018

Net::LDAP::Error (hostname "10.255.5.15" does not match the server certificate)

Does your LDAP server have 10.255.5.15 as a CN or SAN in the SSL certificate?

@kuzevanoff
Copy link

I have the same error, how I can solve it ? I need to ignore server certificate verification

@marcoadkins
Copy link

I am also seeing the same failure after upgrading from 0.8.5 to 0.8.6. Resolved by locking my gemfile to 0.8.5.

@blackham
Copy link

blackham commented Apr 5, 2020

Just my 0.02.
Locking the gem to 0.8.5 solved my errors too. But it looks like the error is in Net::LDAP.

Not sure yet what changed in net-ldap but downgrading net-ldap from 0.16.2 to 0.11 made my connection happy. (Which of course is done when downgrading devise_ldap_authenticatable to 0.8.5)

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

No branches or pull requests

5 participants