A TLS socket class : allow you to both connect to a given server and exchange messages or start your own server and wait for connections.

Static variables

@:keepstaticDEFAULT_CA:Null<Certificate>

Available on cpp, python, neko, php, hl, macro, java

@:value(true)@:keepstaticDEFAULT_VERIFY_CERT:Null<Bool> = true

Available on cpp, python, neko, php, hl, macro, java

Constructor

new()

Variables

@:keepverifyCert:Null<Bool>

Available on cpp, python, neko, php, hl, macro, java

Define if peer certificate is verified during SSL handshake.

Methods

@:keepaddSNICertificate(cbServernameMatch:String ‑> Bool, cert:Certificate, key:Key):Void

Available on cpp, python, neko, php, hl, macro, java

Configure additionals certificates and private keys for Server Name Indication extension. The callback may be called during handshake to determine the certificate to use.

@:keephandshake():Void

Perform the SSL handshake.

@:keeppeerCertificate():Certificate

Available on cpp, python, neko, php, hl, macro, java

Return the certificate received from the other side of a connection.

@:keepsetCA(cert:Certificate):Void

Available on cpp, python, neko, php, hl, macro, java

Configure the certificate chain for peer certificate verification.

@:keepsetCertificate(cert:Certificate, key:Key):Void

Available on cpp, python, neko, php, hl, macro, java

Configure own certificate and private key.

@:keepsetHostname(name:String):Void

Available on cpp, python, neko, php, hl, macro, java

Configure the hostname for Server Name Indication TLS extension.

Inherited Variables

Defined by Socket

@:keepcustom:Dynamic

Available on cpp, cs, python, neko, php, hl, macro, java

A custom value that can be associated with the socket. Can be used to retrieve your custom infos after a select.

@:keepread onlyinput:Input

The stream on which you can read available data. By default the stream is blocking until the requested data is available, use setBlocking(false) or setTimeout to prevent infinite waiting.

@:keepread onlyoutput:Output

The stream on which you can send data. Please note that in case the output buffer you will block while writing the data, use setBlocking(false) or setTimeout to prevent that.

Inherited Methods

Defined by Socket

@:has_untyped@:keephost():{port:Int, host:Host}

Return the information about our side of a connected socket.

@:keeplisten(connections:Int):Void

Allow the socket to listen for incoming questions. The parameter tells how many pending connections we can have until they get refused. Use accept() to accept incoming connections.

@:has_untyped@:keeppeer():{port:Int, host:Host}

Return the information about the other side of a connected socket.

@:keepsetFastSend(b:Bool):Void

Allows the socket to immediately send the data when written to its output : this will cause less ping but might increase the number of packets / data size, especially when doing a lot of small writes.

@:keepsetTimeout(timeout:Float):Void

Gives a timeout (in seconds) after which blocking socket operations (such as reading and writing) will abort and throw an exception.

@:keepshutdown(read:Bool, write:Bool):Void

Shutdown the socket, either for reading or writing.

@:keepwaitForRead():Void

Block until some data is available for read on the socket.