klyn.net.ssl.SSLSocket.attachToSocket
method
public attachToSocket(socket as Socket, host as String, port as Int) as Void throws SSLException:
Description

Upgrades an already-connected TCP socket using this TLS context.

import klyn.net
import klyn.net.ssl

# plain = Socket("example.com", 443)
# secure = SSLSocket()
# secure.attachToSocket(plain, "example.com", 443)
Throws
  • SSLException if the TLS socket is not connected/configured correctly or a TLS transport operation fails.