Problem:
Curl can connect to my Foreman webserver just fine:
$ curl --head https://foreman.example.org
HTTP/1.1 302 Found
Date: Thu, 04 Feb 2021 02:52:05 GMT
...
But Hammer cannot:
$ hammer ping
SSL certificate verification failed
Make sure you configured the correct URL and have the server's CA certificate installed on your system.
The following configuration option were used for the SSL connection:
ssl_ca_file = /etc/ssl/certs/intermediate-cert.pem
Make sure the location contains an unexpired and valid CA certificate for https://foreman.example.org.
$
I suspect that something on the server is misconfigured. Foreman itself seems to work okay as far as I can tell.
How can I verify that the Foreman URL works with the ca file specified by ssl_ca_file
?
Expected outcome:
I expected Hammer to use the server certificate and proceed, just like curl.
Foreman and Proxy versions:
- Foreman: 1.24.3
- Foreman Proxy: 1.24.3
Foreman and Proxy plugin versions:
Foreman Discovery: 16.0.1
Distribution and version:
Ubuntu 18.04.5 LTS
Other relevant data:
Nothing in the server logs.
$ less .hammer/log/hammer.log
[ERROR 2021-02-03T19:00:44 API] SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get issuer certificate)
[ERROR 2021-02-03T19:00:44 Exception] SSL certificate verification failed
Make sure you configured the correct URL and have the server's CA certificate installed on your system.
The following configuration option were used for the SSL connection:
ssl_ca_file = /etc/ssl/certs/intermediate-cert.pem
Make sure the location contains an unexpired and valid CA certificate for https://foreman.example.org.
[ERROR 2021-02-03T19:00:44 Exception]
RestClient::SSLCertificateNotVerified (SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get issuer certificate)):
/usr/lib/ruby/vendor_ruby/restclient/request.rb:758:in `rescue in transmit'
/usr/lib/ruby/vendor_ruby/restclient/request.rb:642:in `transmit'
/usr/lib/ruby/vendor_ruby/restclient/request.rb:145:in `execute'
/usr/lib/ruby/vendor_ruby/restclient/request.rb:52:in `execute'
/usr/lib/ruby/vendor_ruby/restclient/resource.rb:51:in `get'
/usr/lib/ruby/vendor_ruby/apipie_bindings/api.rb:327:in `call_client'
/usr/lib/ruby/vendor_ruby/apipie_bindings/api.rb:240:in `http_call'
/usr/lib/ruby/vendor_ruby/apipie_bindings/api.rb:190:in `call_action'
/usr/lib/ruby/vendor_ruby/apipie_bindings/api.rb:185:in `call'
/usr/lib/ruby/vendor_ruby/apipie_bindings/resource.rb:21:in `call'
/usr/lib/ruby/vendor_ruby/hammer_cli/apipie/command.rb:53:in `send_request'
/usr/lib/ruby/vendor_ruby/hammer_cli_foreman/commands.rb:188:in `send_request'
/usr/lib/ruby/vendor_ruby/hammer_cli/apipie/command.rb:34:in `execute'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:63:in `run'
/usr/lib/ruby/vendor_ruby/hammer_cli/abstract.rb:76:in `run'
/usr/lib/ruby/vendor_ruby/clamp/subcommand/execution.rb:11:in `execute'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:63:in `run'
/usr/lib/ruby/vendor_ruby/hammer_cli/abstract.rb:76:in `run'
/usr/lib/ruby/vendor_ruby/clamp/subcommand/execution.rb:11:in `execute'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:63:in `run'
/usr/lib/ruby/vendor_ruby/hammer_cli/abstract.rb:76:in `run'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:132:in `run'
/usr/bin/hammer:147:in `<main>'