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.