title: Node soap ClientSSLSecurityPFX - 403 Forbidden
body: <p>I'm trying to connect to a SOAP service with <a href="https://github.com/vpulim/node-soap#clientsslsecuritypfx" rel="nofollow noreferrer">node-soap</a> but getting <code>403 - Forbidden</code>. </p>
  
  <p>I have a pfx file and a password and I'm trying:</p>
  
  <pre><code>var pfx = fs.readFileSync(path.join(__dirname, 'folder', 'my.pfx')); // pfx file is in the relative path './folder/my.pfx'
  var password = 'mypassword';
  var options = {
    strictSSL: true,
    rejectUnauthorized: false,
    hostname: myUrl,
    forever: true
  };
  var security = new soap.ClientSSLSecurityPFX(pfx, password, options);
  var url = 'https://theservice.com/ApplicationService.svc?singleWsdl';
  soap.createClient(url, function (err, client) {
    console.log(err);
    console.log(client);
    client.setSecurity(security);
  });
  </code></pre>
  
  <p>But I get 403:</p>
  
  <pre><code>[Error: Invalid WSDL URL: https://theservice.com/ApplicationService.svc?singleWsdl
  
   Code: 403
  
   Response Body: &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/&gt; &lt;title&gt;403 - Forbidden: Access is denied.&lt;/title&gt;...
  
      client.setSecurity(security);
            ^    
  TypeError: Cannot read property 'setSecurity' of undefined
  </code></pre>
  
  <p>I'm able to access the service via browser by installing pfx to the MacOS Keychain. So URL, pfx, password etc. should be ok.</p>
  
  <p>Any ideas on what could be the issue and how to debug? Thanks!</p>