From 2bc45778bfff152d720477d9f8a09a5bb9ce7e8a Mon Sep 17 00:00:00 2001 From: Maximilien Mellen Date: Fri, 29 Mar 2019 17:32:15 +0100 Subject: [PATCH] Use SecureContextOptions in httpsServer.addContext --- types/node/test/tls.ts | 6 ++++++ types/node/tls.d.ts | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/types/node/test/tls.ts b/types/node/test/tls.ts index bdfebce8bb..d5e3ef8fd1 100644 --- a/types/node/test/tls.ts +++ b/types/node/test/tls.ts @@ -1,4 +1,5 @@ import { createSecureContext, SecureContext, ConnectionOptions, connect, getCiphers, DEFAULT_ECDH_CURVE, createServer, TLSSocket } from "tls"; +import * as fs from "fs"; { const ctx: SecureContext = createSecureContext({ @@ -19,6 +20,11 @@ import { createSecureContext, SecureContext, ConnectionOptions, connect, getCiph { const _server = createServer(); + + _server.addContext("example", { + cert: fs.readFileSync("cert_filepath"), + key: fs.readFileSync("key_filepath") + }); } { diff --git a/types/node/tls.d.ts b/types/node/tls.d.ts index ea4192d979..0050a7b025 100644 --- a/types/node/tls.d.ts +++ b/types/node/tls.d.ts @@ -276,11 +276,7 @@ declare module "tls" { } class Server extends net.Server { - addContext(hostName: string, credentials: { - key: string; - cert: string; - ca: string; - }): void; + addContext(hostName: string, credentials: SecureContextOptions): void; /** * events.EventEmitter