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))
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))