def METHOD_NAME(endpoint, cn):
    host = "random"  # any host would work
    subject_dict = get_server_certificate_subject(endpoint.public_ip, host, endpoint.port_ssl)
    assert subject_dict[b"CN"] == cn.encode("ascii")