enum abstract ServerEvent<T>(Event<T>)
package js.node.tls
to Event<T>
import js.node.tls.Server
Enumeration of events emitted by Server
in addition to its parent classes.
Variables
inlineread onlyClientError:ServerEvent<(Error, TLSSocket) ‑> Void> = "clientError"
When a client connection emits an 'error' event before secure connection is established - it will be forwarded here.
Listener arguments:
exception - error object
securePair - the `TLSSocket` that the error originated from
inlineread onlyNewSession:ServerEvent<(Buffer, Buffer, () ‑> Void) ‑> Void> = "newSession"
Emitted on creation of TLS session. May be used to store sessions in external storage.
callback
must be invoked eventually, otherwise no data will be sent or received from secure connection.
Listener arguments:
sessionId
sessionData
callback
inlineread onlyOCSPRequest:ServerEvent<(Buffer, Buffer, (Error, Buffer) ‑> Void) ‑> Void> = "OCSPRequest"
Emitted when the client sends a certificate status request.
You could parse server's current certificate to obtain OCSP url and certificate id,
and after obtaining OCSP response invoke callback(null, resp)
, where resp
is a Buffer
instance.
Both certificate and issuer are a Buffer DER-representations of the primary and issuer's certificates.
They could be used to obtain OCSP certificate id and OCSP endpoint url.
Alternatively, callback(null, null)
could be called, meaning that there is no OCSP response.
Calling callback(err)
will result in a socket.destroy(err)
call.
inlineread onlyResumeSession:ServerEvent<(Buffer, (Error, Buffer) ‑> Void) ‑> Void> = "resumeSession"
Emitted when client wants to resume previous TLS session.
Event listener may perform lookup in external storage using given sessionId, and invoke callback(null, sessionData) once finished.
If session can't be resumed (i.e. doesn't exist in storage) one may call callback(null, null).
Calling callback(err) will terminate incoming connection and destroy socket.
Listener arguments:
sessionId
callback
inlineread onlySecureConnection:ServerEvent<TLSSocket ‑> Void> = "secureConnection"
This event is emitted after a new connection has been successfully handshaked.