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
ParameterDescription
hostRemote host.
portRemote port.
contextTLS 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()