⌂ Modules nupp nupp.io nupp.io.tls nupp.io.tls.spi nupp.io.tls.spi
Implementation interface for TLS transports.
The facade selects during initialization, retains the provider, and supplies its explicit receiver. The provider wraps an opaque network stream handle, so its transport representation must agree with the selected nupp.io.net.spi implementation.
Wrapping creates TLS state; handshake and I/O then report pending work to the facade, which drives readiness. Verification is a policy input and an observable session result. Do not report a verified peer merely because a handshake completed with verification disabled. ALPN protocol text describes the negotiated result; resumed is an optional observation.
closeNotify sends the TLS shutdown notification and may need further progress. destroy releases session state and the transport it owns. No method may resolve or switch providers.
Types
Providerinterface
Members Name Kind Description priorityfield wrapmethod Creates session state over a compatible network handle. handshakemethod Returns true when ready, false while pending, or nil and an error. verifiedmethod Reports whether peer verification succeeded for this session. resumedfield Optionally reports whether this session resumed prior TLS state. readmethod Returns at most wanted bytes, nil while pending, an empty string at EOF, or nil and an error. writemethod Returns a positive byte count no greater than the input length, nil while pending, or nil and an error. flushedmethod Returns true when encrypted output has drained, false while pending, or false with an error on failure. closeNotifymethod Starts or continues orderly TLS shutdown; true means complete, or that the bounded time a drain may take is spent,... destroymethod Releases TLS session state and its owned transport. connectedmethod Reports whether the session remains connected. protocolmethod Returns the negotiated ALPN protocol, or nil when none is available.
wrapmethod
wrap : function (
self : Provider ,
handle : any ,
server : boolean ,
hostname : string ,
certificate : string ,
privateKey : string ,
authority : string ? ,
protocols : string ,
verify : boolean
) : ( any ? , string ? )
@readonly
Creates session state over a compatible network handle. The provider consumes the handle on success and failure.
Certificate, private key, authority, hostname, and ALPN options follow the public TLS API. Returns the session or nil and an error.
Arguments Name Type Description selfProvider handleany serverboolean hostnamestring certificatestring privateKeystring authoritystring ? protocolsstring verifyboolean
Returns Type Description any ? string ?
handshakemethod
handshake : function ( self : Provider , session : any ) : ( boolean ? , string ? )
@readonly
Returns true when ready, false while pending, or nil and an error.
Arguments Name Type Description selfProvider sessionany
Returns Type Description boolean ? string ?
verifiedmethod
@readonly
Reports whether peer verification succeeded for this session.
Arguments Name Type Description selfProvider sessionany
Returns
resumedfield
resumed : ( function ( self : Provider , session : any ) : boolean ) ?
@readonly
Optionally reports whether this session resumed prior TLS state.
readmethod
read : function ( self : Provider , session : any , wanted : integer ) : ( string ? , string ? )
@readonly
Returns at most wanted bytes, nil while pending, an empty string at EOF, or nil and an error.
Arguments Name Type Description selfProvider sessionany wantedinteger
Returns Type Description string ? string ?
writemethod
write : function ( self : Provider , session : any , bytes : string ) : ( integer ? , string ? )
@readonly
Returns a positive byte count no greater than the input length, nil while pending, or nil and an error.
Arguments Name Type Description selfProvider sessionany bytesstring
Returns Type Description integer ? string ?
flushedmethod
flushed : function ( self : Provider , session : any ) : ( boolean , string ? )
@readonly
Returns true when encrypted output has drained, false while pending, or false with an error on failure.
Arguments Name Type Description selfProvider sessionany
Returns Type Description boolean string ?
closeNotifymethod
closeNotify : function ( self : Provider , session : any ) : ( boolean , string ? )
@readonly
Starts or continues orderly TLS shutdown; true means complete, or that the bounded time a drain may take is spent, and false means pending unless accompanied by an error.
Arguments Name Type Description selfProvider sessionany
Returns Type Description boolean string ?
destroymethod
destroy : function ( self : Provider , session : any ) : nil
@readonly
Releases TLS session state and its owned transport.
Arguments Name Type Description selfProvider sessionany
Returns
connectedmethod
connected : function ( self : Provider , session : any ) : boolean
@readonly
Reports whether the session remains connected.
Arguments Name Type Description selfProvider sessionany
Returns
protocolmethod
protocol : function ( self : Provider , session : any ) : string ?
@readonly
Returns the negotiated ALPN protocol, or nil when none is available.
Arguments Name Type Description selfProvider sessionany
Returns
← Previous nupp.io.tls Next → nupp.io.uri