Commit 9c0679b1 authored by Dave Syer's avatar Dave Syer

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.
parent 71fddc51
...@@ -119,6 +119,9 @@ public class RabbitAutoConfiguration { ...@@ -119,6 +119,9 @@ public class RabbitAutoConfiguration {
RabbitProperties.Ssl ssl = config.getSsl(); RabbitProperties.Ssl ssl = config.getSsl();
if (ssl.isEnabled()) { if (ssl.isEnabled()) {
factory.setUseSSL(true); factory.setUseSSL(true);
if (ssl.getAlgorithm() != null) {
factory.setSslAlgorithm(ssl.getAlgorithm());
}
factory.setKeyStore(ssl.getKeyStore()); factory.setKeyStore(ssl.getKeyStore());
factory.setKeyStorePassphrase(ssl.getKeyStorePassword()); factory.setKeyStorePassphrase(ssl.getKeyStorePassword());
factory.setTrustStore(ssl.getTrustStore()); factory.setTrustStore(ssl.getTrustStore());
......
...@@ -217,6 +217,12 @@ public class RabbitProperties { ...@@ -217,6 +217,12 @@ public class RabbitProperties {
*/ */
private String trustStorePassword; private String trustStorePassword;
/**
* The SSL algorithm to use (e.g. TLSv1.1). Default is set automatically by the
* rabbit client library.
*/
private String algorithm;
public boolean isEnabled() { public boolean isEnabled() {
return this.enabled; return this.enabled;
} }
...@@ -257,6 +263,14 @@ public class RabbitProperties { ...@@ -257,6 +263,14 @@ public class RabbitProperties {
this.trustStorePassword = trustStorePassword; this.trustStorePassword = trustStorePassword;
} }
public String getAlgorithm() {
return this.algorithm;
}
public void setAlgorithm(String sslAlgorithm) {
this.algorithm = sslAlgorithm;
}
} }
public static class Listener { public static class Listener {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment