Project

General

Profile

Actions

Refactor #1112

closed

ENC - Self signed certificates

Added by Craig White over 13 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

suggested modifications for extras/puppet/foreman/files/external_node.rb

--- external_node.rb 2011-08-03 09:52:34.287126938 -0700
++ new_external_node.rb 2011-08-15 08:55:50.591256868 -0700
@ -62,9 +62,18 @
def enc
foreman_url = "#{url}/node/#{certname}?format=yml"
uri = URI.parse(foreman_url)

+ # comment the next 2 lines if you need to use self-signed certificates
req = Net::HTTP::Get.new(foreman_url)
res = Net::HTTP.start(uri.host, uri.port) { |http| http.request(req) }

+ # uncomment the next 5 lines if you need to use self-signed certificate
+ # https = Net::HTTP.new(uri.host, uri.port)
+ # https.use_ssl = true
+ # https.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ # req = Net::HTTP::Get.new(foreman_url)
+ # res = https.request(req)
+
raise "Error retrieving node #{certname}: #{res.class}" unless res.code == "200"
res.body
end

Actions

Also available in: Atom PDF