klyn.net.ssl.SSLSocket.SSLSocket
constructor

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

Description

Creates and connects a TLS socket.

Parameters

Parameter | Description
--- | ---
`host` | Remote host.
`port` | Remote port.
`context` | TLS context. Defaults to `SSLContext.clientDefault()`.

Throws

- SSLException when the TLS connection fails.

Example

    import klyn.net.ssl

    socket = SSLSocket("example.com", 443)
    print(socket.isConnected)
    socket.close()