Buenos Https!
Wrap your application in https using embedded self-signed certificates. Not so much for security, but primarily for easily setting up (local) https servers during development.
Installing
$ npm install --save-dev buenos-https
Example
var $buenosHttps = ; // construct an express app for demonstration purposesvar $express = ;var app = ;app; // wrap app in https
API
buenosHttps(app, [options])
Returns an https.Server (which is a subclass of tls.Server) instance.
var $buenosHttps = require('buenos-https');
$buenosHttps(app);
// or
$buenosHttps(app, options);
app
should be a requestListener
; something that can be stuffed into
https.createServer
.
options
is an optional https
options object. See documentation of
tls.createServer
.
By default the options object contains the result of buenosHttps.getDefaultOptions
, the very minimal to set up
a secure server.
buenosHttps.getDefaultOptions()
Returns the default options object, includes the embedded certificates.
var $buenosHttps = ; $buenosHttps; // returns:// {// key: 'server key',// cert: 'server cert'// }