def generate_cert_override(overrides):
    """
    Generate the contents for a cert_override.txt file with entries for
    the given CertOverrideEntry objects.
    """
    contents = (
        '# PSM Certificate Override Settings file\n'
        '# This is a generated file!  Do not edit.\n'
    )

    for override in overrides:
        contents += '\t'.join([
            override.host + ':' + override.port,
            override.fingerprint_algorithm,
            override.fingerprint,
            str(override.mask),
            override.db_key
        ]) + '\n'

    return contents