Browse Source

Deprecate Couchbase SSL keyStore properties

The properties `spring.couchbase.env.ssl.key-store`
and `spring.couchbase.env.ssl.key-store-password`
are deprecated in favor of configuring an SSL bundle with
`spring.couchbase.env.ssl.bundle`. The older properties
have somewhat confusing names, since they are used to
configure a trust store in Couchbase, and they don't
provide all the options that an SSL bundle provides.

Closes gh-35135
pull/35166/head
Scott Frederick 3 years ago
parent
commit
1d44b45b5d
  1. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java
  2. 9
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseProperties.java

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java

@ -129,6 +129,7 @@ public class CouchbaseAutoConfiguration { @@ -129,6 +129,7 @@ public class CouchbaseAutoConfiguration {
.trustManagerFactory(getTrustManagerFactory(this.properties.getEnv().getSsl(), sslBundles)));
}
@SuppressWarnings("removal")
private TrustManagerFactory getTrustManagerFactory(CouchbaseProperties.Ssl ssl, SslBundles sslBundles) {
if (ssl.getKeyStore() != null) {
return loadTrustManagerFactory(ssl);
@ -140,6 +141,7 @@ public class CouchbaseAutoConfiguration { @@ -140,6 +141,7 @@ public class CouchbaseAutoConfiguration {
throw new IllegalStateException("A key store or bundle must be configured when SSL is enabled");
}
@SuppressWarnings("removal")
private TrustManagerFactory loadTrustManagerFactory(CouchbaseProperties.Ssl ssl) {
String resource = ssl.getKeyStore();
try {

9
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseProperties.java

@ -19,6 +19,7 @@ package org.springframework.boot.autoconfigure.couchbase; @@ -19,6 +19,7 @@ package org.springframework.boot.autoconfigure.couchbase;
import java.time.Duration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.util.StringUtils;
/**
@ -177,18 +178,26 @@ public class CouchbaseProperties { @@ -177,18 +178,26 @@ public class CouchbaseProperties {
this.enabled = enabled;
}
@Deprecated(since = "3.1.0", forRemoval = true)
@DeprecatedConfigurationProperty(
reason = "SSL bundle support with spring.ssl.bundle and spring.couchbase.env.ssl.bundle should be used instead")
public String getKeyStore() {
return this.keyStore;
}
@Deprecated(since = "3.1.0", forRemoval = true)
public void setKeyStore(String keyStore) {
this.keyStore = keyStore;
}
@Deprecated(since = "3.1.0", forRemoval = true)
@DeprecatedConfigurationProperty(
reason = "SSL bundle support with spring.ssl.bundle and spring.couchbase.env.ssl.bundle should be used instead")
public String getKeyStorePassword() {
return this.keyStorePassword;
}
@Deprecated(since = "3.1.0", forRemoval = true)
public void setKeyStorePassword(String keyStorePassword) {
this.keyStorePassword = keyStorePassword;
}

Loading…
Cancel
Save