Javascript node.js https pfx证书错误

Javascript node.js https pfx证书错误,javascript,node.js,https,cryptojs,Javascript,Node.js,Https,Cryptojs,我正试图通过附加.pfx证书和密码短语向HTTPS服务器发送请求。但是,我遇到了以下错误: crypto.js:145 c.context.loadPKCS12(pfx); ^ Error: wrong tag at Object.exports.createCredentials (crypto.js:145:17) at Object.exports.connect (tls.js:1331:27) at Object.createConnection (http

我正试图通过附加.pfx证书和密码短语向HTTPS服务器发送请求。但是,我遇到了以下错误:

crypto.js:145
  c.context.loadPKCS12(pfx);
            ^
Error: wrong tag
at Object.exports.createCredentials (crypto.js:145:17)
at Object.exports.connect (tls.js:1331:27)
at Object.createConnection (https.js:79:14)
at new ClientRequest (http.js:1428:26)
at Object.exports.request (https.js:123:10)
at Object.<anonymous> (C:\Users\srmocher\Desktop\Webspaces.js:10:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
这是我的密码:

var https=require('https');
var options={
    hostname:'https://<my-api>'
    method:'GET',
    pfx:"<pfx-data>",
    passphrase:"<pass>",
    agent:false
};
var req=https.request(options,function(res){
    res.on('data',function(d){
        console.log(d);
    })
});

如果有人能帮我理解错误,我会很高兴。

这可能会有帮助。。!我查过了。但是这个错误似乎是Crypto.JS特有的。好吧,让我做一些研究,然后你也做同样的事情。一旦我得到答案,我会把它贴在这里。因为我在开发过程中遇到了同样的问题,我偶然发现了。确实要传递pfx的文件内容而不是字符串吗?