I need help connecting to RabbitMQ with TLS using Node.
The client gave us credentials for connecting to their RabbitMQ server.
They say we don’t need any certificates for TLS connection, and I’m using NodeJS.
We’re getting this error.
OperationalError: certificate has expired
We’re trying to use this Node client library https://github.com/amqp-node/amqplib and in their SSL guide(https://amqp-node.github.io/amqplib/ssl.html) it’s written
If you're not going to use a client certificate, you need only to make sure you will trust the server certificate:
var opts = {
ca: [fs.readFileSync('cacert.pem')]
};
this is our current code
const conn = await connect({
hostname: process.env.RABBITMQ_HOST,
port: Number(process.env.RABBITMQ_PORT),
username: process.env.RABBITMQ_USER,
password: process.env.RABBITMQ_PASSWORD,
vhost: process.env.RABBITMQ_VHOST,
protocol: 'amqps',
}