springboot+rabbitMQ+SSL整合,使用tls-gen生成证书,一直报如下错误!

想使用springboot+rabbitMQ+SSL整合,做一个demo,目前搭建环境是网上搜的tls-gen生成的证书,报错信息如下

报错展示1

2020-05-07 18:39:58.009  WARN 16696 --- [TaskExecutor-20] o.s.a.r.l.SimpleMessageListenerContainer : Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
2020-05-07 18:39:58.009  INFO 16696 --- [TaskExecutor-20] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer@13607d: tags=[{}], channel=null, acknowledgeMode=AUTO local queue size=0
2020-05-07 18:39:58.010  INFO 16696 --- [TaskExecutor-21] o.s.a.r.c.CachingConnectionFactory       : Attempting to connect to: [192.168.150.133:5671]

报错展示2

Failed to check/redeclare auto-delete queue(s). org.springframework.amqp.Amq

报错展示3

org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Co

好多种报错,一直没有找到原因

springboot配置类

server:
  port: 9002
spring:
  application:
    name: qt-mqServer-dev
  rabbitmq:
    host: 192.168.150.133
    port: 5671
    username: admin
    password: admin
    publisher-confirms: true
    ssl:
      enabled: true
      key-store: file:client_key.p12
      key-store-password: 123456
      trust-store: file:server.keystore
      trust-store-password: abcdef
#      algorithm: TLSv1.2
#      key-store-type: PKCS12
#      trust-store-type: JKS
#      validate-server-certificate: true
#      verify-hostname: true
logging.level.org.springframework.boot.autoconfigure: ERROR

由于项目中MQ要连接外网,安全考虑,添加SSL安全验证,所以在本地做了demo测试,但是一直都是报错.

找到答案了
将verify-hostname: true改为false就行了

https://blog.csdn.net/weixin_43204480/category_10013108.html