centos6.9 rabbitmq set up SSL

I. Overview

Due to the requirements of the security team, it is necessary to add SSL to rabbitmq, and the java code uses the ssl key to connect.

2. Formal deployment

Environmental description:

Operating system ip hostname configuration rabbitmq version
centos 6.9 192.168.31.7 mq_01 1 core 2g 3.8.2
centos 6.9 192.168.31.216 mq_02 1 core 2g 3.8.2
centos 6.9 192.168.31.214 mq_03 1 core 2g 3.8.2

The environment is to configure ssl based on the previous article, the link is as follows:

https://www.cnblogs.com/xiao987334176/p/12304608.html

Generate certificate

There is an article on the Internet saying that there is a github project that can generate a certificate with one click. The link is as follows:

https://github.com/Berico-Technologies/CMF-AMQP-Configuration.git

But the generated certificate fails the code test.

Therefore, on github, I found a rabbitmq ssl project, which provides certificates. Just use the certificate inside, and the code test can also pass.

The link is as follows:

https://github.com/Nepitwin/RabbitSSL

There are Python scripts provided, and there are 3 certificate files

ca_certificate.pem
client_certificate.pem
client_key.pem

Next, I will load these 3 files into rabbitmq

Configure rabbitmq

Create a certificate directory

mkdir /etc/rabbitmq/cert

Put the 3 certificate files in this directory

Modify configuration file

vi /etc/rabbitmq/rabbitmq.config

The full content is as follows:

[{ rabbit,[{ssl_listeners,[5671]},{ssl_options,[{cacertfile,"/etc/rabbitmq/cert/ca_certificate.pem"},{certfile,"/etc/rabbitmq/cert/client_certificate.pem"},{keyfile,"/etc/rabbitmq/cert/client_key.pem"},{verify,verify_peer},{fail_if_no_peer_cert,true}]}]}].

Restart rabbitmq

/etc/init.d/rabbitmq-server restart

View 5671 port

Command line view

Log in to any node, use the command line to view

# ss -tunlp|grep 5671
tcp    LISTEN     0128:::5671:::*      users:(("beam.smp",27893,96))

mq background page view

After logging in, click on the Ports and contexts below, you can see 5671

Reference link for this article:

https://blog.csdn.net/tiantang_1986/article/details/83996202

https://www.cnblogs.com/wyt007/p/9086250.html

Recommended Posts

centos6.9 rabbitmq set up SSL
Centos6 set up GitBook environment
centos6.9 rabbitmq 3.6.8 upgrade 3.8.2
How to set up SSH keys on CentOS 8
CentOS 8 complete steps to set up automatic updates
Centos6.9 build rabbitmq 3.6.8 cluster
Install RabbitMQ on CentOS 7
CentOS 7 deploys RabbitMQ service
CentOS 8 Apache enable SSL
install RabbitMQ on centos
Install RabbitMQ on CentOS 7
CentOS online installation RabbitMQ3.7
Install RabbitMQ on CentOS7
Set up a CentOS network with Virtualbox on MacOS
CentOs7.3 build RabbitMQ 3.6 stand-alone service
How to set up an Apache virtual host on CentOS 7
CentOS7 install rabbitmq cluster (binary)
Detailed steps to set up a Git server on CentOS
Set static IP under Centos
CentOS 6 automatically installs RabbitMQ script
How to set up the Nginx server configuration block on CentOS 8
CentOS set ssh key login original
RabbitMQ cluster deployment record under Centos6.9