tlsenum/__init__.py
def send_client_hello(host, port, data):
    """
    Sends a ClientHello message in bytes.

    Returns a ServerHello message in bytes

    """
    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.

    Returns a ServerHello message in bytes

    
Sends a ClientHello message in bytes.
Returns a ServerHello message in bytes
Sends a ClientHello message in bytes . Returns a ServerHello message in bytes
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)
        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()
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 ) 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.
Sends a ClientHello message in bytes .
"""
    Sends a ClientHello message in bytes.

    Returns a ServerHello message in bytes

    """ # This is to handle the case where the server fails # to respond instead of a returning a handshake failure.
host
port
data