def send_client_hello(host, port, data):
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect((host, port))
        s.send(data)

        server_hello = s.recv(5)

        # This is to handle the case where the server fails
        # to respond instead of a returning a handshake failure.
        if len(server_hello) == 0:
            raise HandshakeFailure()

        server_hello += s.recv(UBInt16("length").parse(server_hello[3:5]))

        return server_hello

    except socket.error:
        raise HandshakeFailure()
Sends a ClientHello message in bytes.
dataset/ETHPy150Open Ayrx/tlsenum/tlsenum/__init__.py/send_client_hello