klyn.net.ssl.SSLSocket.fromSocket
method

    public static fromSocket(socket as Socket,
    host as String,
    port as Int,
    context as SSLContext = null) as SSLSocket throws SSLException:

Description

Stable alias of `upgrade(...)` for wrapping an existing TCP socket in TLS.

    import klyn.net
    import klyn.net.ssl

    # plain = Socket("example.com", 443)
    # secure = SSLSocket.fromSocket(plain, "example.com", 443)