Add support for ldaps on port 636

This commit adds support for ldaps on port 636. Without this change vmpooler assumes the auth method is start_tls, which does not work with ldaps.
This commit is contained in:
kirby@puppetlabs.com 2020-03-11 17:44:19 -07:00
parent d653ce482e
commit d879f0ef20

View file

@ -57,11 +57,13 @@ module Vmpooler
end end
def authenticate_ldap(port, host, user_object, base, username_str, password_str) def authenticate_ldap(port, host, user_object, base, username_str, password_str)
auth_method = :start_tls if port == 389
auth_method = :simple_tls if port == 636
ldap = Net::LDAP.new( ldap = Net::LDAP.new(
:host => host, :host => host,
:port => port, :port => port,
:encryption => { :encryption => {
:method => :start_tls, :method => auth_method,
:tls_options => { :ssl_version => 'TLSv1' } :tls_options => { :ssl_version => 'TLSv1' }
}, },
:base => base, :base => base,