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.
This commit is contained in:
Dave Syer 2016-04-28 10:25:29 +01:00
parent 71fddc51df
commit 9c0679b1f4
2 changed files with 17 additions and 0 deletions

View File

@ -119,6 +119,9 @@ public class RabbitAutoConfiguration {
RabbitProperties.Ssl ssl = config.getSsl();
if (ssl.isEnabled()) {
factory.setUseSSL(true);
if (ssl.getAlgorithm() != null) {
factory.setSslAlgorithm(ssl.getAlgorithm());
}
factory.setKeyStore(ssl.getKeyStore());
factory.setKeyStorePassphrase(ssl.getKeyStorePassword());
factory.setTrustStore(ssl.getTrustStore());

View File

@ -217,6 +217,12 @@ public class RabbitProperties {
*/
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() {
return this.enabled;
}
@ -257,6 +263,14 @@ public class RabbitProperties {
this.trustStorePassword = trustStorePassword;
}
public String getAlgorithm() {
return this.algorithm;
}
public void setAlgorithm(String sslAlgorithm) {
this.algorithm = sslAlgorithm;
}
}
public static class Listener {