Skip to content

Instantly share code, notes, and snippets.

@mikermcneil
Created November 14, 2013 03:24
Show Gist options
  • Save mikermcneil/7460835 to your computer and use it in GitHub Desktop.
Save mikermcneil/7460835 to your computer and use it in GitHub Desktop.
/** * An example of how to use a CA certificate in your Sails app. * * Would love to see support for the `ca` key on the main ssl config object * (if you write it up, please just send the PR to the associations branch so it's easier to merge-- thanks!) */
/**
* An example of how to use a CA certificate in your Sails app.
*
* Would love to see support for the `ca` key on the main ssl config object
* (if you write it up, please just send the PR to the associations branch so it's easier to merge-- thanks!)
*/
var fs = require('fs');
//config/express.js
module.exports = {
express: {
// Expects certificates thrown in the root of your Sails app
serverOptions: {
ca: fs.readFileSync(__dirname + '/../gd_bundle.crt'),
key: fs.readFileSync(__dirname + '/../yourApp.key'),
cert: fs.readFileSync(__dirname + '/../yourApp.crt')
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment