<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _check_keyserver(location):
 """Check that a given keyserver is a known protocol and does not contain shell escape characters. :param str location: A string containing the default keyserver. This should contain the desired keyserver protocol which is supported by the keyserver, for example, the default is ``'hkp://wwwkeys .pgp.net'``. :rtype: :obj:`str` or :obj:`None` :returns: A string specifying the protocol and keyserver hostname, if the checks passed. If not, returns None. """

    protocols = ['hkp://', 'hkps://', 'http://', 'https://', 'ldap://',
                 'mailto:'] ## xxx feels like i´m forgetting one...
    for proto in protocols:
        if location.startswith(proto):
            url = location.replace(proto, str())
            host, slash, extra = url.partition('/')
            if extra: log.warn("URI text for %s: '%s'" % (host, extra))
            log.debug("Got host string for keyserver setting: '%s'" % host)

            host = _fix_unsafe(host)
            if host:
                log.debug("Cleaned host string: '%s'" % host)
                keyserver = proto + host
                return keyserver
            return None