def is_bad_chain(domain):
    """
    Domain has a bad chain if its canonical https endpoint has a bad
    chain
    """
    canonical, https, httpswww = (domain.canonical, domain.https, domain.
        httpswww)
    if canonical.host == 'www':
        canonical_https = httpswww
    else:
        canonical_https = https
    return canonical_https.https_bad_chain
