]> git.openstreetmap.org Git - chef.git/commitdiff
Make trac use https when authenticating
authorTom Hughes <tom@compton.nu>
Sat, 10 Feb 2018 17:14:20 +0000 (17:14 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 10 Feb 2018 17:14:20 +0000 (17:14 +0000)
cookbooks/trac/files/default/trac-authenticate

index 489a12ca06825b06d234fa9422a4f4119d8a7bb0..a255637364fbbbc389bfa20d7cb95080914a45ec 100755 (executable)
@@ -9,7 +9,9 @@ pass = gets.chop
 request = Net::HTTP::Get.new("/api/0.6/user/details")
 request.basic_auth user, pass
 
-response = Net::HTTP.new("api.openstreetmap.org").request(request)
+response = Net::HTTP.start("api.openstreetmap.org", :use_ssl => true) do |http|
+  http.request(request)
+end
 
 exit!(0) if response.is_a?(Net::HTTPSuccess)
 exit!(1)