Commit 4c537559 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Added keystore type and truststore type to rabbit properties"

Closes gh-10251
parent b70ac99b
...@@ -113,14 +113,10 @@ public class RabbitAutoConfiguration { ...@@ -113,14 +113,10 @@ public class RabbitAutoConfiguration {
if (ssl.getAlgorithm() != null) { if (ssl.getAlgorithm() != null) {
factory.setSslAlgorithm(ssl.getAlgorithm()); factory.setSslAlgorithm(ssl.getAlgorithm());
} }
if (ssl.getKeyStoreType() != null) { factory.setKeyStoreType(ssl.getKeyStoreType());
factory.setKeyStoreType(ssl.getKeyStoreType());
}
factory.setKeyStore(ssl.getKeyStore()); factory.setKeyStore(ssl.getKeyStore());
factory.setKeyStorePassphrase(ssl.getKeyStorePassword()); factory.setKeyStorePassphrase(ssl.getKeyStorePassword());
if (ssl.getTrustStoreType() != null) { factory.setTrustStoreType(ssl.getTrustStoreType());
factory.setTrustStoreType(ssl.getTrustStoreType());
}
factory.setTrustStore(ssl.getTrustStore()); factory.setTrustStore(ssl.getTrustStore());
factory.setTrustStorePassphrase(ssl.getTrustStorePassword()); factory.setTrustStorePassphrase(ssl.getTrustStorePassword());
} }
......
...@@ -315,9 +315,9 @@ public class RabbitProperties { ...@@ -315,9 +315,9 @@ public class RabbitProperties {
private String keyStore; private String keyStore;
/** /**
* Set the key store type (jks, pkcs12, etc). * Key store type.
*/ */
private String keyStoreType; private String keyStoreType = "PKCS12";
/** /**
* Password used to access the key store. * Password used to access the key store.
...@@ -330,9 +330,9 @@ public class RabbitProperties { ...@@ -330,9 +330,9 @@ public class RabbitProperties {
private String trustStore; private String trustStore;
/** /**
* Set the trust store type (jks, pkcs12, etc). * Trust store type.
*/ */
private String trustStoreType; private String trustStoreType = "JKS";
/** /**
* Password used to access the trust store. * Password used to access the trust store.
......
...@@ -542,7 +542,7 @@ public class RabbitAutoConfigurationTests { ...@@ -542,7 +542,7 @@ public class RabbitAutoConfigurationTests {
@Test @Test
// Make sure that we at least attempt to load the store // Make sure that we at least attempt to load the store
public void enableSslWithNonexistingKeystoreShouldFail() { public void enableSslWithNonExistingKeystoreShouldFail() {
this.contextRunner this.contextRunner
.withUserConfiguration(TestConfiguration.class) .withUserConfiguration(TestConfiguration.class)
.withPropertyValues("spring.rabbitmq.ssl.enabled:true", .withPropertyValues("spring.rabbitmq.ssl.enabled:true",
...@@ -557,7 +557,7 @@ public class RabbitAutoConfigurationTests { ...@@ -557,7 +557,7 @@ public class RabbitAutoConfigurationTests {
@Test @Test
// Make sure that we at least attempt to load the store // Make sure that we at least attempt to load the store
public void enableSslWithNonexistingTruststoreShouldFail() { public void enableSslWithNonExistingTrustStoreShouldFail() {
this.contextRunner this.contextRunner
.withUserConfiguration(TestConfiguration.class) .withUserConfiguration(TestConfiguration.class)
.withPropertyValues( .withPropertyValues(
...@@ -587,7 +587,7 @@ public class RabbitAutoConfigurationTests { ...@@ -587,7 +587,7 @@ public class RabbitAutoConfigurationTests {
} }
@Test @Test
public void enableSslWithInvalidTruststoreTypeShouldFail() throws Exception { public void enableSslWithInvalidTrustStoreTypeShouldFail() throws Exception {
this.contextRunner this.contextRunner
.withUserConfiguration(TestConfiguration.class) .withUserConfiguration(TestConfiguration.class)
.withPropertyValues( .withPropertyValues(
......
...@@ -1051,11 +1051,11 @@ content into your application; rather pick only the properties that you need. ...@@ -1051,11 +1051,11 @@ content into your application; rather pick only the properties that you need.
spring.rabbitmq.requested-heartbeat= # Requested heartbeat timeout, in seconds; zero for none. spring.rabbitmq.requested-heartbeat= # Requested heartbeat timeout, in seconds; zero for none.
spring.rabbitmq.ssl.enabled=false # Enable SSL support. spring.rabbitmq.ssl.enabled=false # Enable SSL support.
spring.rabbitmq.ssl.key-store= # Path to the key store that holds the SSL certificate. spring.rabbitmq.ssl.key-store= # Path to the key store that holds the SSL certificate.
spring.rabbitmq.ssl.key-store-type= # Type of key store (jks, pkcs12,..). Defaults to pkcs12 if not set
spring.rabbitmq.ssl.key-store-password= # Password used to access the key store. spring.rabbitmq.ssl.key-store-password= # Password used to access the key store.
spring.rabbitmq.ssl.key-store-type=PKCS12 # Key store type.
spring.rabbitmq.ssl.trust-store= # Trust store that holds SSL certificates. spring.rabbitmq.ssl.trust-store= # Trust store that holds SSL certificates.
spring.rabbitmq.ssl.trust-store-type= # Type of trust store (jks, pkcs12,..). Defaults to jks if not set
spring.rabbitmq.ssl.trust-store-password= # Password used to access the trust store. spring.rabbitmq.ssl.trust-store-password= # Password used to access the trust store.
spring.rabbitmq.ssl.trust-store-type=JKS # Trust store type.
spring.rabbitmq.ssl.algorithm= # SSL algorithm to use. By default configure by the rabbit client library. spring.rabbitmq.ssl.algorithm= # SSL algorithm to use. By default configure by the rabbit client library.
spring.rabbitmq.template.mandatory=false # Enable mandatory messages. spring.rabbitmq.template.mandatory=false # Enable mandatory messages.
spring.rabbitmq.template.receive-timeout=0 # Timeout for `receive()` methods. spring.rabbitmq.template.receive-timeout=0 # Timeout for `receive()` methods.
......
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