detect HTTP vs HTTPS