smart proxy discovery

We need to test this against HTTPS Foreman.