Tag: pfx

Node.js – crypto.js – PFX头太长

我正试图从一个文件加载一个PFX和口令,以便我可以做一个HTTPS请求。 在我开始之前,我已经知道PFX是好的,这不是问题。 我正在做以下事情: config.options.pfx = fs.readFileSync('file.pfx'); config.options.passphrase = 'passphrase'; 我正在把我的select权交给代理人。 config.options.agent = new https.Agent(options); 然后我尝试build立rquest,我得到以下错误: crypto.js:143 c.context.loadPKCS12(pfx, passphrase); ^ Error: header too long at Object.exports.createCredentials (crypto.js:143:17) at Object.exports.connect (tls.js:1334:27) at Agent.createConnection (https.js:79:14) at Agent.createSocket (http.js:1293:16) at Agent.addRequest (http.js:1269:23) at new ClientRequest (http.js:1416:16) at Object.exports.request (https.js:123:10) 我从一个工作仓库中检查了这一点,我知道这是作者的原作者。 出于某种原因,我的设置不运行它,虽然。

Node.js – HTTPS PFX错误:无法加载BIO

我试图做一个HTTPS请求承诺。 我已经知道PFX是好的,这不是问题(我有一个类似的示例应用程序工作)。 我正在做以下事情: var request = require('request-promise'); … options.pfx = fs.readFileSync('myfile.pfx'); options.passphrase = 'passphrase'; 我正在将我的选项传递给请求。 request.post(options); 然后我尝试构build请求我得到以下错误: _tls_common.js:130 c.context.loadPKCS12(pfx, passphrase); ^ Error: Unable to load BIO at Error (native) at Object.createSecureContext (_tls_common.js:130:17) at Object.exports.connect (_tls_wrap.js:955:21) at Agent.createConnection (https.js:73:22) at Agent.createSocket (_http_agent.js:174:16) at Agent.addRequest (_http_agent.js:143:23) at new ClientRequest (_http_client.js:133:16) at Object.exports.request (http.js:31:10) at Object.exports.request (https.js:163:15) at […]

我在我的node.js https服务器中使用.pfxauthentication,我不能在选项中使用“密码”

我目前正在使用node.js和https进行Web应用程序。 所以我尝试使用我的.pfx(我从http://www.cert-depot.com/获得了这个文件)进行httpsauthentication,如下所示: var https = require('https'); var fs = require('fs'); var options = { pfx: fs.readFileSync('./8ab20f7b-51b9-4c09-a2e0-1918bb9fb37f.pfx') passphrase: 'password' }; var server = https.createServer(options, function (request, response) { fs.readFile('index.html', function (error, data) { response.writeHead(200, {'Content-Type': 'text/html'}); response.end(data); }); }).listen(12345, function(){ console.log('server running'); }); 但是当我用node.js启动这个代码时,我在我的Windows控制台中收到一条错误消息: 密码:“密码” 意外的标识符 我的代码与Node.js( http://nodejs.org/api/https.html#https_https_createserver_options_requestlistener )的官方指南页非常相似,但是我无法启动我的https服务器。 我的密码有什么问题? (我在Windows 8 64位上运行node.js。)

macvalidation失败使用节点与SSL证书

正如Node api文档中所指定的那样,我使用openssl自己创build并签署了一个cert来尝试第一个。 一切都很好,除了不能从androidtesting客户端的事实,因为它需要一个CA证书。 当我尝试第二个方法(用pfx而不用key,cert)时,https.createserver会抛出一个错误 crypto.js:145 c.context.loadPKCS12(pfx); ^ Error: mac verify failure at Object.exports.createCredentials (crypto.js:145:17) at Server (tls.js:1130:28) at new Server (https.js:35:14) at Object.exports.createServer (https.js:54:10) at Object.<anonymous> (C:\iTollonServer\iTollonServer\iTollonServer\app.js:105:7) 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) at Function.Module.runMain (module.js:497:10) 来自Node Api的代码: // curl -k https://localhost:8000/ var https = require('https'); var fs = […]