Skip to main content
Server.prototype.addContext - node__tls.d.ts - Node documentation
method Server.prototype.addContext

Usage in Deno

```typescript import { Server } from "node:node__tls.d.ts"; ```
Server.prototype.addContext(
hostname: string,
): void
The `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.

Parameters

hostname: string
A SNI host name or wildcard (e.g. `'*'`)
An object containing any of the possible properties from the [createSecureContext](../.././node__tls.d.ts/~/createSecureContext) `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created with [createSecureContext](../.././node__tls.d.ts/~/createSecureContext) itself.

Return Type

void