Fix for HTTPS sockets