Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nil ca_certs to trust system CAs #63

Merged
merged 1 commit into from
Jul 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def raw_connect_v4(options = {})
# values, so we need to check the value passed and make a list only if it won't be empty. If it will be empty then
# we should just pass 'nil'.
ca_certs = options[:ca_certs]
ca_certs = nil if ca_certs.blank?
ca_certs = [ca_certs] if ca_certs

url = URI::Generic.build(
Expand All @@ -310,14 +311,19 @@ def raw_connect_v3(options = {})
require 'manageiq/providers/ovirt/legacy/inventory'
Ovirt.logger = $rhevm_log

# If 'ca_certs' is an empty string then the 'ovirt' gem will trust nothing, but we want it to trust the system CA
# certificates. To get that behaviour we need to pass 'nil' instead of the empty string.
ca_certs = options[:ca_certs]
ca_certs = nil if ca_certs.blank?

params = {
:server => options[:server],
:port => options[:port].presence && options[:port].to_i,
:path => options[:path],
:username => options[:username],
:password => options[:password],
:verify_ssl => options[:verify_ssl],
:ca_certs => options[:ca_certs]
:ca_certs => ca_certs
}

read_timeout, open_timeout = ems_timeouts(:ems_redhat, options[:service])
Expand Down