Skip to content

Instantly share code, notes, and snippets.

@sam-github
Created October 19, 2016 18:20
Show Gist options
  • Save sam-github/927a451526de55847d53694b53b01a20 to your computer and use it in GitHub Desktop.
Save sam-github/927a451526de55847d53694b53b01a20 to your computer and use it in GitHub Desktop.
// To cause warnings to be emitted, this needs to be run with:
//
// NODE_EXTRA_CA_CERTS=x.pem
//
// and x.pem having invalid pem, perhaps a beginning of a cert without an end
// line, see below. My goal was to cause something to be printed between the
// BEGIN and END, no success.
//
// -----BEGIN CERTIFICATE-----
function log(s) {
return function() {
process._rawDebug(s);
}
}
process.nextTick(log('A'));
new Promise(function(resolve) {
log('p enter')();
resolve();
}).then(log('p resolved'));
log('BEGIN')();
require('tls').createServer({})
log('END')();
process.nextTick(log('C'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment