projects/ngx-soap/src/lib/soap/security/ClientSSLSecurityPFX.js
function ClientSSLSecurityPFX(pfx, passphrase, defaults) {
  if (typeof passphrase === 'object') {
    defaults = passphrase;
  }
  if (pfx) {
    if (Buffer.isBuffer(pfx)) {
      this.pfx = pfx;
    } else if (typeof pfx === 'string') {
      this.pfx = fs.readFileSync(pfx);
    } else {
      throw new Error('supplied pfx file should be a buffer or a file location');
    }
  }

  if (passphrase) {
    if (typeof passphrase === 'string') {
      this.passphrase = passphrase;
    }
  }
  this.defaults = {};
  _.merge(this.defaults, defaults);
}
function ClientSSLSecurityPFX(pfx, passphrase, defaults) {
  if (typeof passphrase === 'object') {
    defaults = passphrase;
  }
  if (pfx) {
    if (Buffer.isBuffer(pfx)) {
      this.pfx = pfx;
    } else if (typeof pfx === 'string') {
      this.pfx = fs.readFileSync(pfx);
    } else {
      throw new Error('supplied pfx file should be a buffer or a file location');
    }
  }

  if (passphrase) {
    if (typeof passphrase === 'string') {
      this.passphrase = passphrase;
    }
  }
  this.defaults = {};
  _.merge(this.defaults, defaults);
}
function ClientSSLSecurityPFX ( pfx , passphrase , defaults ) { if ( typeof passphrase === 'object' ) { defaults = passphrase ; } if ( pfx ) { if ( Buffer . isBuffer ( pfx ) ) { this . pfx = pfx ; } else if ( typeof pfx === 'string' ) { this . pfx = fs . readFileSync ( pfx ) ; } else { throw new Error ( 'supplied pfx file should be a buffer or a file location' ) ; } } if ( passphrase ) { if ( typeof passphrase === 'string' ) { this . passphrase = passphrase ; } } this . defaults = { } ; _ . merge ( this . defaults , defaults ) ; }
activates SSL for an already existing client using a PFX cert

@module ClientSSLSecurityPFX
@param {Buffer|String}   pfx
@param {String}   passphrase
@constructor
activates SSL for an already existing client using a PFX cert