node.js - mosca MQTT 代理的安全 key 和证书

标签 node.js security ssl mqtt mosca

我正在尝试设置基于node.js的Mosca MQTT代理

根据下面的文档, https://github.com/mcollina/mosca/wiki/TLS-SSL-Configuration

var mosca = require('mosca')

var SECURE_KEY = __dirname + '/../../test/secure/tls-key.pem';
var SECURE_CERT = __dirname + '/../../test/secure/tls-cert.pem';

从哪里获取 tls-key.pemtls-cert.pem

最佳答案

来自链接https://github.com/mcollina/mosca/wiki/TLS-SSL-Configuration在您的问题中,您被定向到另一个链接 https://nodejs.org/api/tls.html#tls_tls_ssl

现在,请按照此链接中的说明进行操作。

$ openssl genrsa -out tls-key.pem 2048
$ openssl req -new -sha256 -key tls-key.pem -out ryans-csr.pem
$ openssl x509 -req -in ryans-csr.pem -signkey tls-key.pem -out tls-cert.pem

给你。您应该拥有 pem 文件。

关于node.js - mosca MQTT 代理的安全 key 和证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39913842/

相关文章:

node.js - 需要JS优化

php - 如何限制API访问受限域名?

java - 在Java中: How to handshake a secured connection using Keystore and Truststore certificate?

Git 克隆在受证书保护的 apache 后面通过 gitlab 故障转移 https

docker - 将证书安装到 Jupyter 笔记本 docker 镜像中

node.js - 如何将单选按钮值传递到 pug/Jade 中的浏览器

node.js - Sinon 函数 stub : How to call "own" function inside module

node.js - npm 更新检查失败

类似于SQLCipher的MySQL加密库

ruby-on-rails - ruby rails 3 : help with sending emails