user91579631 user91579631 - 3 months ago 72
Node.js Question

Security key and cert for mosca MQTT broker

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

From the documentation below,

var mosca = require('mosca')

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

Where do I get


From the link in your question, you are directed to another link

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

There you go. You should have your pem files.