3

Is it possible to configure spring-data-couchbase to connect via SSL?

I have found documentation for how to do this via the SDK, but not in spring-data-couchbase 3.1.4-RELEASE

robjwilkins
  • 5,462
  • 5
  • 43
  • 59
Lewis Watson
  • 543
  • 1
  • 4
  • 15

1 Answers1

2

I think the way to do this is to extend AbstractCouchbaseConfiguration with your own configuration, and then Override the methods in that class with the SSL config as per the SDK documentation. For example:

@Configuration
public class CouchbaseConfig extends AbstractCouchbaseConfiguration {

  @Override
  public CouchbaseEnvironment couchbaseEnvironment() {
    return DefaultCouchbaseEnvironment
        .builder()
        .sslEnabled(true)
        .sslKeystoreFile("/path/tokeystore")
        .sslKeystorePassword("password")
        .build();
  }

}
robjwilkins
  • 5,462
  • 5
  • 43
  • 59
  • I think you may be correct @robjwilkins. I'm having difficulty getting an example to work locally but I suspect the problem is at the SDK level and not `spring-data-couchbase`. Once I have a fully working proof of concept I'll happily accept your answer, and provide a link to the full source code. – Lewis Watson Feb 12 '19 at 11:11