def download_as_pem(
    base_url=d1_common.const.URL_DATAONE_ROOT,
    timeout_sec=d1_common.const.DEFAULT_HTTP_TIMEOUT,
):
    """Download public certificate from a TLS/SSL web server as PEM encoded string.

    Also see download_as_der().

    Args:
        base_url : str
          A full URL to a DataONE service endpoint or a server hostname
        timeout_sec : int or float
          Timeout for the SSL socket operations

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

    """
    return ssl.DER_cert_to_PEM_cert(download_as_der(base_url, timeout_sec))
Download public certificate from a TLS/SSL web server as PEM encoded string.

    Also see download_as_der().

    Args:
        base_url : str
          A full URL to a DataONE service endpoint or a server hostname
        timeout_sec : int or float
          Timeout for the SSL socket operations

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