def confirm_not_old_proxy(loaded_cert):
    """
    Given a cryptography object for the issuer cert, checks if the cert is
    an "old proxy" and raise an error if so.
    """
    # Examine the last CommonName to see if it looks like an old proxy.
    last_cn = loaded_cert.subject.get_attributes_for_oid(x509.oid.NameOID.COMMON_NAME)[
        -1
    ]
    # if the last CN is 'proxy' or 'limited proxy' we are in an old proxy
    if last_cn.value in ("proxy", "limited proxy"):
        raise ValueError(
            "Proxy certificate is in an outdated format " "that is no longer supported"
        )
Given a cryptography object for the issuer cert, checks if the cert is
    an "old proxy" and raise an error if so.