Fix a bug when accessing URLS with non-standard ports

Accessing URLS like http://keyserver.ubuntu.com:11371/ will result in "Client error: getaddrinfo ENOTFOUND".

The host name isn't handled correctly. 

Here is the fix.