From 82cf8e532decfe4e3bcb564d101bb2762b0b560a Mon Sep 17 00:00:00 2001 From: Leo Liang Date: Wed, 28 Dec 2016 06:52:11 +0800 Subject: [PATCH] soap.d.ts: ClientSSLSecurty constructor parameters (#13216) --- soap/index.d.ts | 5 +++-- soap/soap-tests.ts | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/soap/index.d.ts b/soap/index.d.ts index 4262bdb64c..8cb9c43424 100644 --- a/soap/index.d.ts +++ b/soap/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for soap // Project: https://www.npmjs.com/package/soap -// Definitions by: Nicole Wang , Cage Fox +// Definitions by: Leo Liang , Cage Fox // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -15,7 +15,8 @@ export class WSSecurity implements Security { } export class ClientSSLSecurity implements Security { - constructor(key: string, cert: string, ca: string, defaults: any); + constructor(key: Buffer | string, cert: Buffer | string, ca: Buffer | string, defaults?: any); + constructor(key: Buffer | string, cert: Buffer | string, defaults?: any); } interface Client extends events.EventEmitter { diff --git a/soap/soap-tests.ts b/soap/soap-tests.ts index c0d902a642..48b2e2317e 100644 --- a/soap/soap-tests.ts +++ b/soap/soap-tests.ts @@ -11,7 +11,9 @@ soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) { let securityOptions = { hasTimeStamp: false }; client.setSecurity(new soap.WSSecurity('user', 'password', securityOptions)); let defaults = {rejectUnauthorized: false}; - client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', '/path/to/ca',defaults)); + client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', '/path/to/ca', defaults)); + client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', defaults)); + client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', '/path/to/ca')); client.addSoapHeader({}); client.setEndpoint('http://localhost'); client['create']({ name: 'value' }, function(err, result) {