Commit 206741f0a31ca151e77e6ca5338d4ce41766f2aa

Authored by Dmitriy Zaporozhets
2 parents 4416b57f 5ae0d61d

Merge branch 'webhook_verify_none' into 'master'

Disable SSL peer verification for all webhooks

SSL peer verification was silently enabled by the HTTParty upgrade in 8a54fda45957b3755f7c06e5c9b955c794488ff1.
This patch restores the previous behaviour of GitLab 6.3 and earlier.
Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
app/models/web_hook.rb
@@ -28,7 +28,7 @@ class WebHook < ActiveRecord::Base @@ -28,7 +28,7 @@ class WebHook < ActiveRecord::Base
28 def execute(data) 28 def execute(data)
29 parsed_url = URI.parse(url) 29 parsed_url = URI.parse(url)
30 if parsed_url.userinfo.blank? 30 if parsed_url.userinfo.blank?
31 - WebHook.post(url, body: data.to_json, headers: { "Content-Type" => "application/json" }) 31 + WebHook.post(url, body: data.to_json, headers: { "Content-Type" => "application/json" }, verify: false)
32 else 32 else
33 post_url = url.gsub("#{parsed_url.userinfo}@", "") 33 post_url = url.gsub("#{parsed_url.userinfo}@", "")
34 auth = { 34 auth = {
@@ -38,6 +38,7 @@ class WebHook < ActiveRecord::Base @@ -38,6 +38,7 @@ class WebHook < ActiveRecord::Base
38 WebHook.post(post_url, 38 WebHook.post(post_url,
39 body: data.to_json, 39 body: data.to_json,
40 headers: {"Content-Type" => "application/json"}, 40 headers: {"Content-Type" => "application/json"},
  41 + verify: false,
41 basic_auth: auth) 42 basic_auth: auth)
42 end 43 end
43 end 44 end