Fix HTTPS socket connection