Node js soap: unable to create client :Error: unable to verify the first certificate

I am trying to connect the SOAP web service using soap package

Here is my code

var options = {
    wsdl_options: {
      forever: true,
      rejectUnauthorized: false,
      strictSSL: false,
      pfx: fs.readFileSync(__dirname + '/certs/test_cert.pfx'),
      passphrase: '123123'
    }
  };

  soap.createClient(process.env.SOAP_ENDPOINT, options, function (err, client) {
    console.log(err);
    console.log(client);
  });

While executing this I m getting the following error

Error: unable to verify the first certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1531:34)
    at TLSSocket.emit (node:events:378:20)
    at TLSSocket._finishInit (node:_tls_wrap:945:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:719:12) {
  code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
  config: {
    url: '<URL>?WSDL',
    method: 'get',

Not sure why I am getting this however I am successfully able to connect through the soap UI in that I am using a p12 file.