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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0e191b4c
Commit
0e191b4c
authored
Aug 07, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow users to disable SSL verification if not connecting to github.com
parent
68f568d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
lib/github/client.rb
lib/github/client.rb
+15
-4
No files found.
lib/github/client.rb
View file @
0e191b4c
...
...
@@ -10,6 +10,7 @@ module Github
faraday
.
options
.
timeout
=
options
.
fetch
(
:timeout
,
TIMEOUT
)
faraday
.
authorization
'token'
,
options
.
fetch
(
:token
)
faraday
.
adapter
:net_http
faraday
.
ssl
.
verify
=
verify_ssl
end
@rate_limit
=
RateLimit
.
new
(
connection
)
...
...
@@ -29,14 +30,24 @@ module Github
end
def
custom_endpoint
Gitlab
.
config
.
omniauth
.
providers
.
find
{
|
provider
|
provider
.
name
==
'github'
}
.
to_h
.
dig
(
'args'
,
'client_options'
,
'site'
)
github_omniauth_provider
.
dig
(
'args'
,
'client_options'
,
'site'
)
end
def
verify_ssl
# If there is no config, we're connecting to github.com
# and we should verify ssl.
github_omniauth_provider
.
fetch
(
'verify_ssl'
,
true
)
end
def
github_endpoint
OmniAuth
::
Strategies
::
GitHub
.
default_options
[
:client_options
][
:site
]
end
def
github_omniauth_provider
@github_omniauth_provider
||=
Gitlab
.
config
.
omniauth
.
providers
.
find
{
|
provider
|
provider
.
name
==
'github'
}
.
to_h
end
end
end
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