SSL integration

74 views
Skip to first unread message

rene matias riveros salinas

unread,
Jul 9, 2015, 12:51:43 AM7/9/15
to sai...@googlegroups.com
Hi guys, I have the task to integrate ssl with a app that we developed with sails js. I was taking a look that in many tutorials recommends to setup the ssl certificates on the local.js config file. My question is if is possible to specify the ssl certificate on the environment configurations(development/production.js).

Other thing I want to know is if adding the ssl to the app config, it applies the ssl to the web socket connection too?if not, how can I tell to sails socket to use ssl?

John Tomaselli

unread,
Sep 10, 2015, 12:17:29 AM9/10/15
to sails.js

I use OpenSSL-Win64 and usually buy cert fom Godaddy but have also used others.
Have only tested in local.js and not sure about sockets but I imagine you are good to go.
HTH
John

place the following in config.local.js
var fs = require('fs');
var fs = require('fs');
module.exports = {
 port: process.env.PORT || 443,
   host: 'x.x.x.x',
    environment:  'development',
ssl : {
key: fs.readFileSync(__dirname + '/ssl/1438289547.xx.com.key'),  // private key
        ca: fs.readFileSync(__dirname + '/ssl/1438289547.xx.com.cabundle'),// gd_bundle-g2-g1.crt'),
        cert: fs.readFileSync(__dirname + '/ssl/1438289547.xx.com.cert'),  // begin cert...
        passphrase: 'psasword'
}
};

Reply all
Reply to author
Forward
0 new messages