From cfc1e899765141b43e8bb08e692573e404ae29ed Mon Sep 17 00:00:00 2001 From: igormukhin <618760+igormukhin@users.noreply.github.com> Date: Wed, 13 May 2026 18:02:09 +0200 Subject: [PATCH] Treat empty RabbitMQ SSL bundle as unset See gh-50429 Signed-off-by: igormukhin <618760+igormukhin@users.noreply.github.com> --- .../boot/autoconfigure/amqp/RabbitProperties.java | 2 +- .../boot/autoconfigure/amqp/RabbitPropertiesTests.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java index f7ebb20ef33..89009ecbe81 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java @@ -474,7 +474,7 @@ public class RabbitProperties { * @see #getEnabled() () */ public boolean determineEnabled() { - boolean defaultEnabled = Boolean.TRUE.equals(getEnabled()) || this.bundle != null; + boolean defaultEnabled = Boolean.TRUE.equals(getEnabled()) || StringUtils.hasText(this.bundle); if (CollectionUtils.isEmpty(RabbitProperties.this.parsedAddresses)) { return defaultEnabled; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java index 54bfb6985bf..df69eca39ea 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitPropertiesTests.java @@ -335,6 +335,12 @@ class RabbitPropertiesTests { assertThat(this.properties.getSsl().determineEnabled()).isTrue(); } + @Test + void determineSslEnabledIsFalseWhenBundleIsEmpty() { + this.properties.getSsl().setBundle(""); + assertThat(this.properties.getSsl().determineEnabled()).isFalse(); + } + @Test void propertiesUseConsistentDefaultValues() { ConnectionFactory connectionFactory = new ConnectionFactory();