]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/trac/files/default/trac-authenticate
Redirect forum.osm.org to forum.openstreetmap.org for https connections
[chef.git] / cookbooks / trac / files / default / trac-authenticate
index cfd33e756f8c75a8d56e572d68a4870707d0f85b..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.kind_of?(Net::HTTPSuccess)
+exit!(0) if response.is_a?(Net::HTTPSuccess)
 exit!(1)