From 4c509c9423a11feb665e98e91661fc0a06a043a1 2007-10-16 19:09:21 From: Jean-Philippe Lang Date: 2007-10-16 19:09:21 Subject: [PATCH] Added LDAPS support for LDAP authentication. git-svn-id: http://redmine.rubyforge.org/svn/trunk@844 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/auth_source_ldap.rb b/app/models/auth_source_ldap.rb index fcb8447..c8b0a12 100644 --- a/app/models/auth_source_ldap.rb +++ b/app/models/auth_source_ldap.rb @@ -70,7 +70,8 @@ private def initialize_ldap_con(ldap_user, ldap_password) Net::LDAP.new( {:host => self.host, :port => self.port, - :auth => { :method => :simple, :username => ldap_user, :password => ldap_password }} + :auth => { :method => :simple, :username => ldap_user, :password => ldap_password }, + :encryption => (self.tls ? :simple_tls : nil)} ) end diff --git a/app/views/auth_sources/_form.rhtml b/app/views/auth_sources/_form.rhtml index b6365dc..24d2913 100644 --- a/app/views/auth_sources/_form.rhtml +++ b/app/views/auth_sources/_form.rhtml @@ -9,7 +9,7 @@ <%= text_field 'auth_source', 'host' %>

-<%= text_field 'auth_source', 'port', :size => 6 %>

+<%= text_field 'auth_source', 'port', :size => 6 %> <%= check_box 'auth_source', 'tls' %> LDAPS

<%= text_field 'auth_source', 'account' %>