本文介绍了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.pem
和tls-cert.pem
?
推荐答案
从链接 https://github.com/mcollina/mosca/wiki/TLS-SSL-Configuration ,您将被引至另一个链接 https://nodejs.org/api/tls.html#tls_tls_ssl
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代理的安全密钥和证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!