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
# This is a generated file!  Do not edit.
"""
    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
