From d879f0ef20bccfa17522c838a57a0c647eec0b15 Mon Sep 17 00:00:00 2001 From: "kirby@puppetlabs.com" Date: Wed, 11 Mar 2020 17:44:19 -0700 Subject: [PATCH] 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. --- lib/vmpooler/api/helpers.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vmpooler/api/helpers.rb b/lib/vmpooler/api/helpers.rb index 0b98143..ec84e7f 100644 --- a/lib/vmpooler/api/helpers.rb +++ b/lib/vmpooler/api/helpers.rb @@ -57,11 +57,13 @@ module Vmpooler end 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( :host => host, :port => port, :encryption => { - :method => :start_tls, + :method => auth_method, :tls_options => { :ssl_version => 'TLSv1' } }, :base => base,