Project

General

Profile

Bug #3081

Not setting ssl_ca, ssl_cert or ssl_key doesn't turn off the authentication in ENC

Added by Ivan Necas over 9 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Foreman modules
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

This patch should be enough to understand the issue

 if SETTINGS[:ssl_ca] && !SETTINGS[:ssl_ca].empty?
       http.ca_file = SETTINGS[:ssl_ca]
       http.verify_mode = OpenSSL::SSL::VERIFY_PEER
     else
       http.verify_mode = OpenSSL::SSL::VERIFY_NONE
     end
-    if SETTINGS[:ssl_cert] and SETTINGS[:ssl_key]
+    if SETTINGS[:ssl_cert] && !SETTINGS[:ssl_cert].empty? && SETTINGS[:ssl_key] && !SETTINGS[:ssl_key].empty?
       http.cert = OpenSSL::X509::Certificate.new(File.read(SETTINGS[:ssl_cert]))
       http.key  = OpenSSL::PKey::RSA.new(File.read(SETTINGS[:ssl_key]), nil)
     end

Associated revisions

Revision a3512676 (diff)
Added by Ivan Necas over 9 years ago

Fixes #3081 - proper handling of disabling ssl verification

Empty ssl_ca, ssl_cert and ssl_key mean not to use ssl verification/authentication

History

#2 Updated by Dominic Cleal over 9 years ago

  • Status changed from New to Closed
  • Target version set to 1.3.0
  • % Done changed from 0 to 100

Also available in: Atom PDF