Fixes #3601: Use secure websockets if available

This will need testing since I haven't tried with certificates yet. It
would also be nice to have a PR in puppet-foreman to use the same keys
as apache.
shouldnt this match the browser https session? this way the user would approve the cert before getting to this phase?