Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
soap.createClient(self.wsdl, self.settings, function (err, client) {
if (!err) {
if (debug.enabled) {
debug('wsdl loaded: %s', self.wsdl);
}
if (self.settings.security || self.settings.username) {
var sec = null;
var secConfig = self.settings.security || self.settings;
if (debug.enabled) {
debug('configuring security: %j', secConfig);
}
switch (secConfig.scheme) {
case 'WS':
case 'WSSecurity':
sec = new soap.WSSecurity(secConfig.username, secConfig.password,
secConfig.passwordType || secConfig.options);
break;
case 'WSSecurityCert':
sec = new soap.WSSecurityCert(
secConfig.privatePEM,
secConfig.publicP12PEM,
secConfig.password,
secConfig.encoding
);
break;
case 'ClientSSL':
if (secConfig.pfx) {
sec = new soap.ClientSSLSecurityPFX(
secConfig.pfx,
secConfig.passphrase,
secConfig.options