mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-26 02:32:49 +00:00
Use SecureContextOptions in httpsServer.addContext
This commit is contained in:
parent
f45c277760
commit
2bc45778bf
@ -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")
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
6
types/node/tls.d.ts
vendored
6
types/node/tls.d.ts
vendored
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user