Added Proper HTTPS Handling