loopbackio / loopback-connector-soap

LoopBack's SOAP based Web Services Connector
Other
82 stars 46 forks source link

TypeError: Cannot read property 'pfx' of null #85

Closed elankeeran closed 7 years ago

elankeeran commented 7 years ago

Security enables throws 'pfx' of null from soap-connector.js:100:20.

To enable security

'security': {
        'scheme': 'ClientSSL'
}
/lib/soap-connector.js:100
            if (sec.pfx) {
                   ^

TypeError: Cannot read property 'pfx' of null
    at /Volumes/Data/work/OpenBanking/git/aisp/ob-aisp-account-info-enterprise-direct-api/node_modules/loopback-connector-soap/lib/soap-connector.js:100:20

in soap-connector.js line no 79 var sec = null; and line no 100 check for if (sec.pfx) {} so its throws error.

line no 79 need to changes as var sec = {};

I fixed the issue, I will give the pull request

mschmidt712 commented 7 years ago

I believe, but am not sure, that sec on line 99 should actually be secConfig which is set on line 80 to the security settings (var secConfig = self.settings.security || self.settings;)

elankeeran commented 7 years ago

@mschmidt712 yes you're correct I have changed according to your comment let me write some unit test for ClientSSL and give you the pull request.