简体   繁体   中英

Node.js + SSL support

Recent commits reference TLS progress. Any idea when it will be ready?

If not, what are the options for using SSL with a node app at the present time? Reverse proxy nginx? Is there a good tutorial available for using SSL with node?

Most professional apps need to support SSL these days and it would be great to be able to use node for these now.

Node.js 0.3.4 has been released.

  • Primordal mingw build (Bert Belder)
  • HTTPS server
  • Built in debugger 'node debug script.js'
  • realpath files during module load (Mihai Călin Bazon)
  • Rename net.Stream to net.Socket
  • Fix process.platform

Example

var https = require('https');
var fs = require('fs');

var options = {
  key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};

https.createServer(options, function (req, res) {
  res.writeHead(200);
  res.end("hello world\n");
}).listen(8000);

Node 3.x is not supposed to be used in production, it's unstable, bleeding edge development. 2.6 still has the old SSL implementation, which works.

If you want to know when all the stuff gets finished, your best bet is to either ask on the Google Group , or Ryan on Twitter .

Just for reference ... here's a JavaScript implementation of SSL/TLS:

https://github.com/digitalbazaar/forge

At the moment, it is only a client-side implementation. It would need to be expanded to cover server-side. For someone with a little knowledge about how TLS works, however, it shouldn't be too difficult to add to the existing framework.

From my experience node 0.2 SSL support is very flacky and unreliable. We use nginx as a proxy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM