node.js - SSL connection code fails with error code ENOTFOUND on bluemix, but code works perfectly on localhost -
i have application makes outbound https request internal server fetch data , sends data client. when run code on local machine, works expected. however, when push code bluemix, error enotfound.
here code:
var options = { host: 'servername', path: "path", port: '7988', key: fs.readfilesync('server.key'), cert: fs.readfilesync('mycertificate.crt'), rejectunauthorized: false }; options.agent = new https.agent(options); var gis_req = https.get(options, function(gis_res) { gis_res.on('data', function(d) { res.send("" + d); }); gis_res.on('error', function(e) { res.send("" + e); }); }); gis_req.on('error', function(e) { res.send("gis req error " + e); });
edit: code works fine on both server , local machine http requests, not https.
Comments
Post a Comment