code: def load_x509_cert(url, httpc, spec2key, **get_args):
      
      try:
          r = httpc('GET', url, allow_redirects=True, **get_args)
          if r.status_code == 200:
              cert = str(r.text)
              try:
                  public_key = spec2key[cert]  # If I've already seen it
              except KeyError:
                  public_key = import_rsa_key(cert)
                  spec2key[cert] = public_key
              if isinstance(public_key, rsa.RSAPublicKey):
                  return {"rsa": public_key}
          else:
              raise Exception("HTTP Get error: %s" % r.status_code)
      except Exception as err:  # not a RSA key
          logger.warning("Can't load key: %s" % err)
          return []
docs: Get and transform a X509 cert into a key.
  
      :param url: Where the X509 cert can be found
      :param httpc: HTTP client to use for fetching
      :param spec2key: A dictionary over keys already seen
      :param get_args: Extra key word arguments to the HTTP GET request
      :return: List of 2-tuples (keytype, key)