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
2d7d1fa6
Commit
2d7d1fa6
authored
Jun 09, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass configured `ssl_version` to `omniauth-ldap`
parent
c8dd77de
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
lib/gitlab/ldap/config.rb
lib/gitlab/ldap/config.rb
+2
-0
spec/lib/gitlab/ldap/config_spec.rb
spec/lib/gitlab/ldap/config_spec.rb
+31
-0
No files found.
lib/gitlab/ldap/config.rb
View file @
2d7d1fa6
...
...
@@ -74,6 +74,8 @@ 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 @
2d7d1fa6
...
...
@@ -301,6 +301,37 @@ describe Gitlab::LDAP::Config, lib: true do
end
end
context
'when ssl_version is present'
do
it
'passes it through'
do
stub_ldap_config
(
options:
{
'host'
=>
'ldap.example.com'
,
'port'
=>
686
,
'encryption'
=>
'simple_tls'
,
'verify_certificates'
=>
true
,
'ssl_version'
=>
'TLSv1_2'
}
)
expect
(
config
.
omniauth_options
).
to
include
({
ssl_version:
'TLSv1_2'
})
end
end
context
'when ssl_version is blank'
do
it
'does not include the ssl_version option'
do
stub_ldap_config
(
options:
{
'host'
=>
'ldap.example.com'
,
'port'
=>
686
,
'encryption'
=>
'simple_tls'
,
'verify_certificates'
=>
true
,
'ssl_version'
=>
' '
}
)
expect
(
config
.
omniauth_options
).
not_to
have_key
(
:ssl_version
)
end
end
end
describe
'#has_auth?'
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