Skip to content

Commit dd3e7ff

Browse files
committed
Default LDAP config verify_certificates to true
1 parent cbaa015 commit dd3e7ff

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

config/gitlab.yml.example

+2-3
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,8 @@ production: &base
273273
encryption: 'plain'
274274

275275
# Enables SSL certificate verification if encryption method is
276-
# "start_tls" or "simple_tls". (Defaults to false for backward-
277-
# compatibility)
278-
verify_certificates: false
276+
# "start_tls" or "simple_tls". Defaults to true.
277+
verify_certificates: true
279278

280279
# Specifies the path to a file containing a PEM-format CA certificate,
281280
# e.g. if you need to use an internal CA.

config/initializers/1_settings.rb

+5-12
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,11 @@ def cron_random_weekly_time
155155
server['encryption'] = 'simple_tls' if server['encryption'] == 'ssl'
156156
server['encryption'] = 'start_tls' if server['encryption'] == 'tls'
157157

158-
# Certificates are not verified for backwards compatibility.
159-
# This default should be flipped to true in 9.5.
160-
if server['verify_certificates'].nil?
161-
server['verify_certificates'] = false
162-
163-
message = <<-MSG.strip_heredoc
164-
LDAP SSL certificate verification is disabled for backwards-compatibility.
165-
Please add the "verify_certificates" option to gitlab.yml for each LDAP
166-
server. Certificate verification will be enabled by default in GitLab 9.5.
167-
MSG
168-
Rails.logger.warn(message)
169-
end
158+
# Certificate verification was added in 9.4.2, and defaulted to false for
159+
# backwards-compatibility.
160+
#
161+
# Since GitLab 10.0, verify_certificates defaults to true for security.
162+
server['verify_certificates'] = true if server['verify_certificates'].nil?
170163

171164
Settings.ldap['servers'][key] = server
172165
end

doc/administration/auth/ldap.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,12 @@ main: # 'main' is the GitLab 'provider ID' of this LDAP server
8787
encryption: 'plain'
8888
8989
# Enables SSL certificate verification if encryption method is
90-
# "start_tls" or "simple_tls". (Defaults to false for backward-
91-
# compatibility)
92-
verify_certificates: false
90+
# "start_tls" or "simple_tls". Defaults to true since GitLab 10.0 for
91+
# security. This may break installations upon upgrade to 10.0, that did
92+
# not know their LDAP SSL certificates were not setup properly. For
93+
# example, when using self-signed certificates, the ca_file path may
94+
# need to be specified.
95+
verify_certificates: true
9396
9497
# Specifies the path to a file containing a PEM-format CA certificate,
9598
# e.g. if you need to use an internal CA.

0 commit comments

Comments
 (0)