How to programmatically check whether an URL uses the HTTPS protocol (scheme)?