You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm using request 2.55.0 and I'm having problems capturing one exception.
This is my code using https:
var https = require('https');
var options_https = {
hostname: 'one_url',
port: 443,
path: '/',
method: 'POST',
headers: {
'Content-Type': 'text/plain'
},
maxattempts: 1,
body: 'one body',
pfx: {
type: 'Buffer',
data: [0, 130, 17, 128, 2, 1, 3]
},
passphrase: 'one_passphrase'
};
options_https.agent = new https.Agent(options_https);
var req;
try {
req = https.request(options_https, function (res) {
console.log('this is the response:', res);
});
req.end();
} catch (e) {
console.log('THIS IS WERE I CAPTURE THE EXCEPTION', e);
}
This is my code using request:
var request = require('request');
var options = {
url: 'https://www.one_url.com',
method: 'POST',
body: 'one body',
headers: {
'Content-Type': 'text/plain'
},
agentOptions: {
pfx: {
type: 'Buffer',
data: [0, 130, 17, 128, 2, 1, 3]
},
passphrase: 'one_passphrase'
}
};
console.log(options);
request(options, function (err, result, body) {
console.log('this is the err ', err);
console.log('this is the result ', result);
console.log('this is the body ', body);
}).on('error', function (exception) {
console.log('this is he exception, plese dont bury ', exception);
});
Am I doing something wrong? in the request example I don't capture the exception created:
_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:958: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 Request.start (/Users/jesus/git/postmen.worker/node_modules/request/request.js:963:30)
Jesus
The text was updated successfully, but these errors were encountered:
Hello,
I'm using request 2.55.0 and I'm having problems capturing one exception.
This is my code using https:
This is my code using request:
Am I doing something wrong? in the request example I don't capture the exception created:
Jesus
The text was updated successfully, but these errors were encountered: