Allow url for key server

As some of the places dont have port 11371 open, sometimes it is necessary to use url instead of domain name for the key_server entry. Therefore the check of the $key_server using is_domain_name is not going to work for this case.

Instead of using is_domain_name,validating with regex instead to check both cases - when user pass in domain or url would allow us to use both domain name or url.