Improve SSL/HTTPS support