Skip to content

Instantly share code, notes, and snippets.

@milgner
Created April 30, 2014 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milgner/23544a28b9045fccab35 to your computer and use it in GitHub Desktop.
Save milgner/23544a28b9045fccab35 to your computer and use it in GitHub Desktop.
Gitlab CI: optional SSL certificate validation
--- 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