mosca MQTT代理的安全密钥和证书 [英] Security key and cert for mosca MQTT broker

查看:125
本文介绍了mosca MQTT代理的安全密钥和证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试建立基于node.js的Mosca MQTT代理

I am trying to set up Mosca MQTT broker which is based on node.js

从下面的文档中, 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 ,您将被引至另一个链接

From the link https://github.com/mcollina/mosca/wiki/TLS-SSL-Configuration in your question, you are directed to another link https://nodejs.org/api/tls.html#tls_tls_ssl

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

Now, follow the instructions in this link.

$ 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文件.

There you go. You should have your pem files.

这篇关于mosca MQTT代理的安全密钥和证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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