From a48fffc4db2a62a55b5d496b6106e21e1373ee3d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 16 Aug 2013 14:55:52 +0300 Subject: [PATCH] Fix ldap adapter for ssl connection --- lib/gitlab/ldap/adapter.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/gitlab/ldap/adapter.rb b/lib/gitlab/ldap/adapter.rb index e90a31c5a8..bf41e7cb61 100644 --- a/lib/gitlab/ldap/adapter.rb +++ b/lib/gitlab/ldap/adapter.rb @@ -10,17 +10,20 @@ module Gitlab attr_reader :ldap def initialize + encryption = config['method'].to_s == 'ssl' ? :simple_tls : nil + options = { host: config['host'], port: config['port'], + encryption: encryption } auth_options = { auth: { - method: config['method'], - username: config['bind_dn'], - password: config['password'] - } + method: :simple, + username: config['bind_dn'], + password: config['password'] + } } if config['password'] || config['bind_dn']