soap.d.ts: ClientSSLSecurty constructor parameters (#13216)

This commit is contained in:
Leo Liang
2016-12-28 06:52:11 +08:00
committed by Andy
parent be8241af5b
commit 82cf8e532d
2 changed files with 6 additions and 3 deletions

5
soap/index.d.ts vendored
View File

@@ -1,6 +1,6 @@
// Type definitions for soap
// Project: https://www.npmjs.com/package/soap
// Definitions by: Nicole Wang <https://github.com/nicoleWjie>, Cage Fox <https://github.com/cagefox>
// Definitions by: Leo Liang <https://github.com/aleung>, Cage Fox <https://github.com/cagefox>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -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 {

View File

@@ -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) {