Fix HTTPS client bug