Rabbitmq Web Stomp Plugin 启用SSL


开发环境:

  前端:Vue+Stompjs     

  后端:Rabbitmq Web Stomp Plugin

 

Rabbitmq安装插件:[rabbitmq_management,rabbitmq_mqtt,rabbitmq_stomp,rabbitmq_web_mqtt,rabbitmq_web_mqtt_examples,rabbitmq_web_stomp,rabbitmq_web_stomp_examples].

 

硬件环境:使用的阿里云windos server2008系统

阿里云中下载pfx证书。使用如下的代码转化成Rabbitmq需要配置的证书:

提取ca证书:
openssl pkcs12 -in 4000000_www.xxxx.com.pfx -nodes -password pass:域名证书密码 -nokeys -cacerts -out cacert.pem

提取server证书:
openssl pkcs12 -in  4000000_www.xxxx.com.pfx -nodes -password pass:域名证书密码 -nokeys -clcerts -out cert.pem

提取私钥(密码:123456)
openssl pkcs12 -in  4000000_www.xxxx.com.pfx -nodes -password pass:123456 -passout pass:123456 -nocerts -out private_key.pem

 

配置rabbitmq.conf文件需要配置如下内容:

listeners.ssl.default = 5671
ssl_options.verify               = verify_peer
ssl_options.fail_if_no_peer_cert = false
ssl_options.cacertfile           = C:\\RabbitMQServer\\certFiles\\cacert.pem
ssl_options.certfile             = C:\\RabbitMQServer\\certFiles\\cert.pem
ssl_options.keyfile              = C:\\RabbitMQServer\\certFiles\\private_key.pem

web_stomp.ssl.port       = 15673
web_stomp.ssl.backlog    = 1024
web_stomp.ssl.cacertfile = C:\\RabbitMQServer\\certFiles\\cacert.pem
web_stomp.ssl.certfile   = C:\\RabbitMQServer\\certFiles\\cert.pem
web_stomp.ssl.keyfile    = C:\\RabbitMQServer\\certFiles\\private_key.pem
web_stomp.ssl.password   = 123456
 
前端Vue 连接配置:
Stomp.client('wss://www.xxxx.com:15673/ws');
 
如果不是阿里云的话,需要使用openssl自制证书。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM