Created
April 30, 2014 11:11
-
-
Save milgner/23544a28b9045fccab35 to your computer and use it in GitHub Desktop.
Gitlab CI: optional SSL certificate validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/app/models/network.rb | |
+++ b/app/models/network.rb | |
@@ -7,6 +7,7 @@ class Network | |
opts = { | |
body: api_opts.to_json, | |
headers: {"Content-Type" => "application/json"}, | |
+ verify: verify? | |
} | |
endpoint = File.join(url, API_PREFIX, 'session.json') | |
@@ -23,6 +24,7 @@ class Network | |
opts = { | |
query: api_opts, | |
headers: {"Content-Type" => "application/json"}, | |
+ verify: verify? | |
} | |
endpoint = File.join(url, API_PREFIX, 'user.json') | |
@@ -109,4 +111,10 @@ class Network | |
nil | |
end | |
end | |
+ | |
+ protected | |
+ | |
+ def verify? | |
+ GitlabCi.config[:verify_ssl] || true | |
+ end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment