Set verify_mode to OpenSSL::SSL::VERIFY_NONE in dev env

#660
This commit is contained in:
Artur Beljajev 2018-01-26 11:18:20 +02:00
parent 578d60cf44
commit 46f11155cb

View file

@ -30,6 +30,16 @@ class Registrar
verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http| verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|
http.request(request) http.request(request)
end end
elsif Rails.env.development?
client_cert = File.read(ENV['cert_path'])
client_key = File.read(ENV['key_path'])
response = Net::HTTP.start(uri.hostname, uri.port,
use_ssl: (uri.scheme == 'https'),
verify_mode: OpenSSL::SSL::VERIFY_NONE,
cert: OpenSSL::X509::Certificate.new(client_cert),
key: OpenSSL::PKey::RSA.new(client_key)) do |http|
http.request(request)
end
else else
client_cert = File.read(ENV['cert_path']) client_cert = File.read(ENV['cert_path'])
client_key = File.read(ENV['key_path']) client_key = File.read(ENV['key_path'])