简体   繁体   English

Node.js + SSL支持

[英]Node.js + SSL support

Recent commits reference TLS progress. 最近提交的参考TLS进展。 Any idea when it will be ready? 什么时候准备就绪?

If not, what are the options for using SSL with a node app at the present time? 如果没有,目前在节点应用程序中使用SSL的选项有哪些? Reverse proxy nginx? 反向代理nginx? Is there a good tutorial available for using SSL with node? 是否有一个很好的教程可用于与节点一起使用SSL?

Most professional apps need to support SSL these days and it would be great to be able to use node for these now. 现在大多数专业应用程序都需要支持SSL,现在可以使用node来实现这些目标。

Node.js 0.3.4 has been released. Node.js 0.3.4已经发布。

  • Primordal mingw build (Bert Belder) Primordal mingw build(Bert Belder)
  • HTTPS server HTTPS服务器
  • Built in debugger 'node debug script.js' 内置调试器'node debug script.js'
  • realpath files during module load (Mihai Călin Bazon) 模块加载期间的realpath文件(MihaiCălinBazon)
  • Rename net.Stream to net.Socket 将net.Stream重命名为net.Socket
  • Fix process.platform 修复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. Node 3.x 应该用于生产,它不稳定,前沿发展。 2.6 still has the old SSL implementation, which works. 2.6仍然有旧的SSL实现,这是有效的。

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: 仅供参考......这是SSL / TLS的JavaScript实现:

https://github.com/digitalbazaar/forge 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. 但是,对于对TLS如何工作有一点了解的人来说,添加到现有框架应该不会太困难。

From my experience node 0.2 SSL support is very flacky and unreliable. 根据我的经验,节点0.2 SSL支持非常脆弱且不可靠。 We use nginx as a proxy. 我们使用nginx作为代理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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