var HttpsProxyAgent = require('https-proxy-agent');
var request = require('request');
var sslRootCAs = require('ssl-root-cas/latest')
sslRootCAs.inject()
var proxy = 'http://192.168.1.243:8888';
var agent = new HttpsProxyAgent(proxy);
request({
uri: "https://vk.com",
method: "POST",
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
agent: agent,
timeout: 10000,
followRedirect: true,
maxRedirects: 10,
body: "name=john"
}, function(error, response, body) {
console.log("Error" + error);
console.log("Response: " + response);
console.log("Body: " + body);
});
пробую сделать такой запрос
получаю ответ
ErrorError: unable to verify the first certificate
Response: undefined
Body: undefined
как исправить?