Improved HTTPS checking