Hi
.getPeerCertificate() does not returned fingerprint after first https.request(). It seems to be a problem with https.agent. If i set agent to false during https.request(opts) then i got correctly the fingerprint at each time.
Here is an example:
consthttps=require("https");functionrequest(){varoptions={hostname: 'www.google.com',port: 443,path: "/",method: 'GET',// turning this to True makes fingerprint works again (agent's connections are closed);//agent: false, rejectUnauthorized: false};varreq=https.request(options,(res)=>{res.fingerprint=res.connection.getPeerCertificate().fingerprint;vardata='';res.on('data',(d)=>{data+=d;});res.on('end',()=>{console.log("got data",res.fingerprint);setTimeout(request,1000);});}).on('error',(e)=>{console.error(e);});req.end();}request();
Hi
.getPeerCertificate() does not returned fingerprint after first https.request(). It seems to be a problem with https.agent. If i set agent to false during https.request(opts) then i got correctly the fingerprint at each time.
Here is an example: