Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
612b3864
Commit
612b3864
authored
Jun 08, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set `Net::LDAP` `ssl_version` option
parent
dcc12505
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
lib/gitlab/ldap/config.rb
lib/gitlab/ldap/config.rb
+1
-0
spec/lib/gitlab/ldap/config_spec.rb
spec/lib/gitlab/ldap/config_spec.rb
+30
-0
No files found.
lib/gitlab/ldap/config.rb
View file @
612b3864
...
...
@@ -192,6 +192,7 @@ module Gitlab
end
opts
[
:ca_file
]
=
options
[
'ca_file'
]
if
options
[
'ca_file'
].
present?
opts
[
:ssl_version
]
=
options
[
'ssl_version'
]
if
options
[
'ssl_version'
].
present?
opts
end
...
...
spec/lib/gitlab/ldap/config_spec.rb
View file @
612b3864
...
...
@@ -168,6 +168,36 @@ describe Gitlab::LDAP::Config, lib: true do
expect
(
config
.
adapter_options
[
:encryption
][
:tls_options
]).
not_to
have_key
(
:ca_file
)
end
end
context
'when ssl_version is specified'
do
it
'passes it through in tls_options'
do
stub_ldap_config
(
options:
{
'host'
=>
'ldap.example.com'
,
'port'
=>
686
,
'encryption'
=>
'simple_tls'
,
'ssl_version'
=>
'TLSv1_2'
}
)
expect
(
config
.
adapter_options
[
:encryption
][
:tls_options
]).
to
include
({
ssl_version:
'TLSv1_2'
})
end
end
context
'when ssl_version is a blank string'
do
it
'does not add the ssl_version key to tls_options'
do
stub_ldap_config
(
options:
{
'host'
=>
'ldap.example.com'
,
'port'
=>
686
,
'encryption'
=>
'simple_tls'
,
'ssl_version'
=>
' '
}
)
expect
(
config
.
adapter_options
[
:encryption
][
:tls_options
]).
not_to
have_key
(
:ssl_version
)
end
end
end
describe
'#omniauth_options'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment