Created
March 21, 2017 12:30
-
-
Save umutm/94a8563153a9d618c1312c58c5d19646 to your computer and use it in GitHub Desktop.
SSL Handshake session/cache issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request') | |
var r = request({ | |
url: 'https://google.com/', | |
method: 'HEAD', | |
gzip: true, | |
followRedirect: false, | |
followAllRedirects: false | |
}); | |
r.on('response', function(res) { | |
certDetails = (res.req.connection.getPeerCertificate()) | |
console.log('*********1st Request**********'); | |
console.log(certDetails); | |
}) | |
setTimeout (function() { | |
var r = request({ | |
url: 'https://google.com/', | |
method: 'HEAD', | |
gzip: true, | |
followRedirect: false, | |
followAllRedirects: false | |
}); | |
r.on('response', function(res) { | |
certDetails = (res.req.connection.getPeerCertificate()) // works | |
console.log('*********2nd Request**********'); | |
console.log(certDetails); | |
}) | |
}, 5000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment