Skip to content

Instantly share code, notes, and snippets.

@julien-f
Last active February 27, 2020 14:44
Show Gist options
  • Save julien-f/aad2bf5ae906bccf005ff0627f83d8a8 to your computer and use it in GitHub Desktop.
Save julien-f/aad2bf5ae906bccf005ff0627f83d8a8 to your computer and use it in GitHub Desktop.
Show TLS/SSL certificate (node)
#!/usr/bin/env node
const [, , host, port = 443, ca] = process.argv;
require("tls")
.connect(
{ host, port, rejectUnauthorized: false, servername: host },
function() {
console.log(this.getPeerCertificate());
this.destroy();
}
)
.on("error", function(error) {
console.error(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment