Fixed error caused by using port 80 for HTTPS connections
Only put port 443 if parsed uri has no port