SHARE
TWEET

Untitled

a guest Jun 25th, 2019 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const https = require('https')
  2. const express = require('express')
  3. const selfsigned = require('selfsigned')
  4.  
  5. const app = express()
  6. app.get('/', (req, res) => res.send('hello'))
  7.  
  8. const attrs = [{name: 'commonName', value: 'example.com'}]
  9. const pems = selfsigned.generate(attrs, {days: 365})
  10. https.createServer({key: pems.private, cert: pems.cert}, app).listen(5001)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top