Skip to content

Instantly share code, notes, and snippets.

@jrop
Created November 3, 2016 16:44
Show Gist options
  • Save jrop/51ba4b0f65f116690969623e30c7da69 to your computer and use it in GitHub Desktop.
Save jrop/51ba4b0f65f116690969623e30c7da69 to your computer and use it in GitHub Desktop.
Generate a self-signed certificate using Node.JS
'use strict'
const selfsigned = require('selfsigned')
const pems = selfsigned.generate(null, {
days: 365 * 10,
keySize: 2048,
algorithm: 'sha256',
})
console.log(pems.private)
console.log(pems.public)
console.log(pems.cert)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment