Feature #7916
openForeman WebUI should give clearer error message when foreman-proxy cannot be contacted
Description
When trying to add a proxy to foreman via the Web UI, the error given is:
---------------
Unable to save
Unable to communicate with the proxy: ERF12-2530 [ProxyAPI::ProxyException]: Unable to detect features ([RestClient::Forbidden]: 403 Forbidden) for proxy https://foreman.nerdalize.com:8443/features
Please check the proxy is configured and running on the host.
---------------
This is not as helpful as the error message given by SSL:
------
$ curl --cert /var/lib/puppet/ssl/certs/my.domain.name.com.pem --key /var/lib/puppet/ssl/private_keys/my.domain.name.pem https://my.domain.name.com:8443/features k
Untrusted client localhost attempted to access /features. Check :trusted_hosts: in settings.yml
-----
This is fixed by adding 'localhost' to the list of trusted hosts (this doesn't sound like the ideal solution either, but it's the first step I could achieve).
My suggestion is to have the Foreman Web UI display the error message given by the proxy-webserver, so that the admin does not need to figure out the proper curl command.