def _load_certificate(location):
    """
    Load a certificate from the given location.

    Args:
        location (str): The location to load. This can either be an HTTPS URL or an absolute file
            path. This is intended to be used with PEM-encoded certificates and therefore assumes
            ASCII encoding.

    Returns:
        str: The PEM-encoded certificate as a unicode string.

    Raises:
        requests.exception.RequestException: Any exception requests could raise.
        IOError: If the location provided could not be opened and read.
    """
    if location.startswith('https://'):
        _log.info('Downloading x509 certificate from %s', location)
        with requests.Session() as session:
            session.mount('https://', requests.adapters.HTTPAdapter(max_retries=3))
            response = session.get(location, timeout=30)
            response.raise_for_status()
            return response.text
    else:
        _log.info('Loading local x509 certificate from %s', location)
        with open(location, 'rb') as fd:
            return fd.read().decode('ascii')