-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.httpsIssues or PRs related to the https subsystem.Issues or PRs related to the https subsystem.tlsIssues and PRs related to the tls subsystem.Issues and PRs related to the tls subsystem.
Description
- Version: v4.4.6
- Platform: Linux xxx 3.16.0-76-generic Updated README with less node.js-centric content, and more Node Forward. #98~14.04.1-Ubuntu SMP Fri Jun 24 17:04:54 UTC 2016
- Subsystem: n/a
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:
const https = require("https");
function request() {
var options = {
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
};
var req = https.request(options, (res) => {
res.fingerprint = res.connection.getPeerCertificate().fingerprint;
var data = '';
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();
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.httpsIssues or PRs related to the https subsystem.Issues or PRs related to the https subsystem.tlsIssues and PRs related to the tls subsystem.Issues and PRs related to the tls subsystem.