예제 #1
0
def SecSocketConnection(host, username, password, port = DEFAULT_PORT):
    """shorthand for creating secure socket connections"""
    try:
        stream = SocketStream.from_new_secure_socket(host, port, username, password)
    except:
        raise LoginError("authentication failure")
    return Connection(Channel(stream))
예제 #2
0
def SecSocketConnection(host, username, password, port=DEFAULT_PORT):
    """shorthand for creating secure socket connections"""
    try:
        stream = SocketStream.from_new_secure_socket(host, port, username,
                                                     password)
    except:
        raise LoginError("authentication failure")
    return Connection(Channel(stream))