I want to establish a TLS-encrypted connection to an AMQP-broker in Windows using Javascript. I don't want to use a client certificate, I only need to accept the brokers certificate, which is signed by a standard certificate authority.
My reference is code from a program running on a Ubuntu system, which looks like this:
var options = {
ca: [fs.readFileSync("/etc/ssl/certs/ca-certificates.crt")]
};
amqp.connect('amqps://myBroker', options, function(error, connection) {
if (error)
throw error;
// Connection established
});
The problem is that, from what I've read, there is no equivalent to the file /etc/ssl/certs/ca-certificates.crt in Windows. Instead, the CA certificates are stored in a registry entry and you need special tools to access it. I need to do it programmatically though. Also, a lot of the information is really old (including related questions on this site), so I don't know how trustworthy it is .
Has anyone done this before? Or knows a good and up-to-date source?
Edit: So there is a command line tool to manage certificates (Certmgr.exe), but that is installed with Visual Studio, so I can't rely on it. The only tool that is installed with Windows itself (Certmgr.msc) is a GUI tool.