[Bug 39125] Connecting to a HTTPS server which has an invalid certificate fails