Validate URL specified by SignatureCertChainUrl.

    See `validate.request` for additional info.

    Args:
        url: str. SignatureCertChainUrl header value sent by request.

    Returns:
        bool: True if valid, False otherwise.

def signature_cert_chain_url(url):
    """Validate URL specified by SignatureCertChainUrl.

    See `validate.request` for additional info.

    Args:
        url: str. SignatureCertChainUrl header value sent by request.

    Returns:
        bool: True if valid, False otherwise.
    """
    r = urlparse(url)
    if not r.scheme.lower() == 'https':
        warnings.warn('Certificate URL scheme is invalid.')
        return False
    if not r.hostname.lower() == 's3.amazonaws.com':
        warnings.warn('Certificate URL hostname is invalid.')
        return False
    if not os.path.normpath(r.path).startswith('/echo.api/'):
        warnings.warn('Certificate URL path is invalid.')
        return False
    if r.port and not r.port == 443:
        warnings.warn('Certificate URL port is invalid.')
        return False
    return True