The tls module uses OpenSSL to provide Transport Layer Security and/or Secure Socket Layer: encrypted stream communication.
Static variables
staticSLAB_BUFFER_SIZE:Int
Size of slab buffer used by all tls servers and clients. Default: 10 * 1024 * 1024.
Don't change the defaults unless you know what you are doing.
Static methods
staticconnect(options:TlsConnectOptions, ?callback:() ‑> Void):TLSSocket
staticconnect(port:Int, ?callback:() ‑> Void):TLSSocket
staticconnect(port:Int, options:TlsConnectOptions, ?callback:() ‑> Void):TLSSocket
staticconnect(port:Int, host:String, ?callback:() ‑> Void):TLSSocket
staticconnect(port:Int, host:String, options:TlsConnectOptions, ?callback:() ‑> Void):TLSSocket
Creates a new client connection to the given port
and host
(old API) or options.port
and options.host
.
If host
is omitted, it defaults to 'localhost'.
staticcreateSecureContext(?details:Null<SecureContextOptions>):SecureContext
Creates a credentials object.
staticcreateSecurePair(?context:SecureContext, ?isServer:Bool, ?requestCert:Bool, ?rejectUnauthorized:Bool):SecurePair
Creates a new secure pair object with two streams, one of which reads/writes encrypted data, and one reads/writes cleartext data. Generally the encrypted one is piped to/from an incoming encrypted data stream, and the cleartext one is used as a replacement for the initial encrypted stream.
staticcreateServer(options:TlsCreateServerOptions, ?secureConnectionListener:TLSSocket ‑> Void):Server
Creates a new Server
.
The connectionListener
argument is automatically set as a listener for the 'secureConnection' event.