class Server
extends net.Server
Accepts encrypted connections using TLS or SSL.
Constructors Jump to heading
new
Jump to headingServer(secureConnectionListener?: (socket: TLSSocket) => void)new
Jump to headingServer(options: TlsOptions,secureConnectionListener?: (socket: TLSSocket) => void,)Methods Jump to heading
Jump to headingaddContext(hostname: string,context: SecureContextOptions,): voidThe server.addContext() method adds a secure context that will be used if
the client request's SNI name matches the supplied hostname (or wildcard).
When there are multiple matching contexts, the most recently added one is used.
Jump to headingaddListener(event: string,listener: (...args: any[]) => void,): thisevents.EventEmitter
- tlsClientError
- newSession
- OCSPRequest
- resumeSession
- secureConnection
- keylog
Jump to headingaddListener(event: "tlsClientError",listener: (err: Error,tlsSocket: TLSSocket,) => void,): thisJump to headingaddListener(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: () => void,) => void,): thisJump to headingaddListener(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): thisJump to headingaddListener(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error | null,sessionData: Buffer | null,) => void,) => void,): thisJump to headingaddListener(event: "secureConnection",listener: (tlsSocket: TLSSocket) => void,): thisJump to headingaddListener(event: "keylog",listener: (line: Buffer,tlsSocket: TLSSocket,) => void,): thisJump to headingemit(event: string | symbol,...args: any[],): booleanJump to headingemit(): booleanJump to headingemit(event: "newSession",sessionId: Buffer,sessionData: Buffer,callback: () => void,): booleanJump to headingemit(event: "OCSPRequest",certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,): booleanJump to headingemit(event: "resumeSession",sessionId: Buffer,callback: (err: Error | null,sessionData: Buffer | null,) => void,): booleanJump to headingemit(event: "secureConnection",tlsSocket: TLSSocket,): booleanJump to headingemit(): booleanJump to headinggetTicketKeys(): BufferReturns the session ticket keys.
See Session Resumption for more information.
Jump to headingon(event: string,listener: (...args: any[]) => void,): thisJump to headingon(event: "tlsClientError",listener: (err: Error,tlsSocket: TLSSocket,) => void,): thisJump to headingon(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: () => void,) => void,): thisJump to headingon(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): thisJump to headingon(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error | null,sessionData: Buffer | null,) => void,) => void,): thisJump to headingon(event: "secureConnection",listener: (tlsSocket: TLSSocket) => void,): thisJump to headingon(event: "keylog",listener: (line: Buffer,tlsSocket: TLSSocket,) => void,): thisJump to headingonce(event: string,listener: (...args: any[]) => void,): thisJump to headingonce(event: "tlsClientError",listener: (err: Error,tlsSocket: TLSSocket,) => void,): thisJump to headingonce(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: () => void,) => void,): thisJump to headingonce(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): thisJump to headingonce(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error | null,sessionData: Buffer | null,) => void,) => void,): thisJump to headingonce(event: "secureConnection",listener: (tlsSocket: TLSSocket) => void,): thisJump to headingonce(event: "keylog",listener: (line: Buffer,tlsSocket: TLSSocket,) => void,): thisJump to headingprependListener(event: string,listener: (...args: any[]) => void,): thisJump to headingprependListener(event: "tlsClientError",listener: (err: Error,tlsSocket: TLSSocket,) => void,): thisJump to headingprependListener(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: () => void,) => void,): thisJump to headingprependListener(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): thisJump to headingprependListener(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error | null,sessionData: Buffer | null,) => void,) => void,): thisJump to headingprependListener(event: "secureConnection",listener: (tlsSocket: TLSSocket) => void,): thisJump to headingprependListener(event: "keylog",listener: (line: Buffer,tlsSocket: TLSSocket,) => void,): thisJump to headingprependOnceListener(event: string,listener: (...args: any[]) => void,): thisJump to headingprependOnceListener(event: "tlsClientError",listener: (err: Error,tlsSocket: TLSSocket,) => void,): thisJump to headingprependOnceListener(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: () => void,) => void,): thisJump to headingprependOnceListener(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): thisJump to headingprependOnceListener(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error | null,sessionData: Buffer | null,) => void,) => void,): thisJump to headingprependOnceListener(event: "secureConnection",listener: (tlsSocket: TLSSocket) => void,): thisJump to headingprependOnceListener(event: "keylog",listener: (line: Buffer,tlsSocket: TLSSocket,) => void,): thisJump to headingsetSecureContext(options: SecureContextOptions): voidThe server.setSecureContext() method replaces the secure context of an
existing server. Existing connections to the server are not interrupted.
Jump to headingsetTicketKeys(keys: Buffer): voidSets the session ticket keys.
Changes to the ticket keys are effective only for future server connections. Existing or currently pending server connections will use the previous keys.
See Session Resumption for more information.