method
quic.QuicEndpoint.setSNIContexts
): void;
Replaces or updates the SNI TLS contexts for this endpoint. This allows changing the TLS identity (key/certificate) used for specific host names without restarting the endpoint. Existing sessions are unaffected — only new sessions will use the updated contexts.
endpoint.setSNIContexts({
'api.example.com': { keys: [newApiKey], certs: [newApiCert] },
});
// Replace the entire SNI map
endpoint.setSNIContexts({
'api.example.com': { keys: [newApiKey], certs: [newApiCert] },
}, { replace: true });@param entries
An object mapping host names to TLS identity options. Each entry must include keys and certs.
Referenced types
interface SNIEntry
- certs: ArrayBuffer | ArrayBufferView<ArrayBufferLike> | readonly unknown[]
The TLS certificates. Required.
- port?: number
The port to advertise in ORIGIN frames (RFC 9412) for this host name. Default:
443. Only used for HTTP/3 sessions.