Fix so that the proxy settings are used for HTTPS connections too

Before HTTPS connections didn't go via the proxy, with this change, the same proxy configuration is used for HTTPS as HTTP when using a HTTP proxy.