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
This commit is contained in:
Scott Frederick 2023-04-24 14:45:40 -05:00
parent 9cd04c55fb
commit 1d44b45b5d
2 changed files with 11 additions and 0 deletions

View File

@ -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 {
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 {

View File

@ -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 {
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;
}