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

pass our CA cert when configuring Pulp3 Client #11190

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions app/models/katello/concerns/smart_proxy_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,11 @@ def pulp3_ssl_configuration(config, connection_adapter = Faraday.default_adapter
when :excon
config.ssl_client_cert = ::Cert::Certs.ssl_client_cert_filename
config.ssl_client_key = ::Cert::Certs.ssl_client_key_filename
config.ssl_ca_file = ::Cert::Certs.ca_cert_filename
when :net_http
config.ssl_client_cert = ::Cert::Certs.ssl_client_cert
config.ssl_client_key = ::Cert::Certs.ssl_client_key
config.ssl_ca_file = ::Cert::Certs.ca_cert_filename
else
fail "Unexpected connection_adapter #{Faraday.default_adapter}! Cannot continue, this is likely a bug."
end
Expand Down
6 changes: 5 additions & 1 deletion app/services/cert/certs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ def self.ueber_cert(organization)
organization.debug_cert
end

def self.ca_cert_filename
Setting[:ssl_ca_file]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but… is that the right file?
it's /etc/foreman/proxy_ca.pem, which is the one we use to talk to proxies.
but here, were talking to Pulpcore via Apache, and Apache will be using the server-ca?

@ehelms halp

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, but I still prefer #8832 which defaults to that file while still allowing to override it if needed. It also works it into the ping controller.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's /etc/foreman/proxy_ca.pem, which is the one we use to talk to proxies.
but here, were talking to Pulpcore via Apache, and Apache will be using the server-ca?

And that should be correct and fine: see https://github.com/theforeman/foreman-installer/pull/965/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R165

end

def self.ca_cert
File.read(Setting[:ssl_ca_file])
File.read(ca_cert_filename)
end

def self.candlepin_client_ca_cert
Expand Down
Loading