Allow initializing tls.Server with no args

This commit is contained in:
Maximilien Mellen
2019-03-29 17:31:54 +01:00
parent 4277a6e538
commit f45c277760
2 changed files with 5 additions and 0 deletions

View File

@@ -17,6 +17,10 @@ import { createSecureContext, SecureContext, ConnectionOptions, connect, getCiph
const curve: string = DEFAULT_ECDH_CURVE;
}
{
const _server = createServer();
}
{
let _server = createServer({});
let _boolean: boolean;

1
types/node/tls.d.ts vendored
View File

@@ -385,6 +385,7 @@ declare module "tls" {
* Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined.
*/
function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined;
function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server;
function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;