Skip to content

Commit 9c0679b

Browse files
author
Dave Syer
committed
Add support for spring.rabbitmq.ssl.algorithm
Rabbit client 3.6.* uses TLSv1.1 as the default algorithm which many brokers are deisabling these days. Spring AMQP supports changing the algorithm by name, so this is just a pass thru for that.
1 parent 71fddc5 commit 9c0679b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ public CachingConnectionFactory rabbitConnectionFactory(RabbitProperties config)
119119
RabbitProperties.Ssl ssl = config.getSsl();
120120
if (ssl.isEnabled()) {
121121
factory.setUseSSL(true);
122+
if (ssl.getAlgorithm() != null) {
123+
factory.setSslAlgorithm(ssl.getAlgorithm());
124+
}
122125
factory.setKeyStore(ssl.getKeyStore());
123126
factory.setKeyStorePassphrase(ssl.getKeyStorePassword());
124127
factory.setTrustStore(ssl.getTrustStore());

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ public static class Ssl {
217217
*/
218218
private String trustStorePassword;
219219

220+
/**
221+
* The SSL algorithm to use (e.g. TLSv1.1). Default is set automatically by the
222+
* rabbit client library.
223+
*/
224+
private String algorithm;
225+
220226
public boolean isEnabled() {
221227
return this.enabled;
222228
}
@@ -257,6 +263,14 @@ public void setTrustStorePassword(String trustStorePassword) {
257263
this.trustStorePassword = trustStorePassword;
258264
}
259265

266+
public String getAlgorithm() {
267+
return this.algorithm;
268+
}
269+
270+
public void setAlgorithm(String sslAlgorithm) {
271+
this.algorithm = sslAlgorithm;
272+
}
273+
260274
}
261275

262276
public static class Listener {

0 commit comments

Comments
 (0)