コード例 #1
0
ファイル: Factories.py プロジェクト: 292388900/restcommander
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
ファイル: Factories.py プロジェクト: microrepar/siga
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))