nodejs 可以生成 SSL 证书吗? [英] Can nodejs generate SSL certificates?

查看:22
本文介绍了nodejs 可以生成 SSL 证书吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个支持 HTTPS-HTTPS 代理的代理.之前使用 Python 作为主要编程语言,但现在对 node.js 感兴趣,所以我准备迁移.

I'm writing a proxy support HTTPS-HTTPS proxy. Before i use Python as the main programming language, but i'm interested in node.js now, so i prepare to migrate.

我面临的最大问题是我不知道如何在 node.js 中生成 CA 和其他服务器证书.在 Python 中,有很棒的 pyOpenSSL.直到现在我在 node.js 中都没有找到类似的东西.

The largest problem i'm facing is that i don't know how to generate CA and other server certificates in node.js. In Python, there is pyOpenSSL which is awesome. I don't find something similar in node.js until now.

也许我应该使用 openssl-fork 方法?但是如何处理openssl中的交互操作.

Maybe i should use openssl-fork method? But how to handle the interactive operation in openssl.

谢谢.

推荐答案

如果有人确实想从 node.js 以编程方式创建 CSR,我有 创建了一个 nodejs 模块,它使用 openssl 创建一个私钥和一个 CSR.

In case somebody does want to programatically create CSRs from node.js, I have created a nodejs module which uses openssl to create a private key and a CSR.

改用 pem.它要完整得多,也可能更可靠.

Use pem instead. It is much more complete and probably more reliable.

Edit2:实际上,pem 也只是对 openssh 的一个简单包装.对于纯 js 实现,请查看 forge

Actually, pem is also just a simple wrapper over openssh. For a pure js implementation, look into forge

这篇关于nodejs 可以生成 SSL 证书吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆