klyn.net.ssl.SSLContext.openSocket
method
public openSocket(host as String, port as Int) as SSLSocket throws SSLException:
Description

Opens a TLS socket using this context.

Parameters
ParameterDescription
hostRemote host.
portRemote port.
Returns

Connected TLS socket.

Throws
  • SSLException if TLS options, certificates, trust paths, or socket creation are invalid.
Example
import klyn.net.ssl

socket = SSLContext.clientDefault().openSocket("example.com", 443)
print(socket.isConnected)