Search code examples
spring-bootspring-rabbit

Springboot 1.5 to springboot 2.0.9 migration failed for rabbitmq ssl


We have spring-boot 1.5 & spring-boot-starter-amqp:1.5.22 application in aws cloud and working fine with rabbitmq ssl enabled. After spring-boot 2.0.9 migration, rabbitmq ssl failed with following error.

ERROR o.s.a.r.l.SimpleMessageListenerContainer - Failed to check/redeclare auto-delete queue(s).
           org.springframework.amqp.AmqpIOException: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
            at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:71)
            at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:407)
            at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:588)
            at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1445)
            at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1426)
            at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1402)
            at org.springframework.amqp.rabbit.core.RabbitAdmin.getQueueProperties(RabbitAdmin.java:368)
            at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.redeclareElementsIfNecessary(SimpleMessageListenerContainer.java:1241)
            at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1502)

Migration from Springboot 1.5 with rabbitmq to 2.0.9 Expected to connect rabbitmq with ssl enabled property.


Solution

  • Springboot2 we can skip the ssl certificate validation using setSkipServerCertificateValidation flag to true in rabbitmqconnectionfactory.