DESCRIPTION

JVMCBC-468: Allow to optionally specify a different TrustStore

Motivation
----------
In certain deployments it can make sense to split up the KeyManager and
TrustManager certificate management in different files / keystores.

Modifications
-------------
This changeset allows to optionally provide a different keystore for
the trust manager, if its not provided it just falls back to the
global keystore used, as before.

Note that to be semantically correct if only the truststore is provided,
it is also used for both the key store and the trust store since that's
most of the time what people want. Also, javadoc has been updated
and improved to represent the semantics better.

Result
------
More flexible certificate management with the SDK if different
keystores should be used for the key and trust managers

Change-Id: Icb025b867a43fb535fe932c7407c902078f771f7


COMMENTS

author: Natasha Sullivan
date: 2017-10-12 15:09:15.063000000

Uploaded patch set 2.

-------------------------------------
author: Hugo Blankenship
date: 2017-10-12 15:09:20.194000000

Patch Set 2:

Build Started http://sdkbuilds.sc.couchbase.com/job/couchbase-jvm-core-test/103/

-------------------------------------
author: Hugo Blankenship
date: 2017-10-12 15:10:41.393000000

Patch Set 2: Verified+1

Build Successful 

http://sdkbuilds.sc.couchbase.com/job/couchbase-jvm-core-test/103/ : SUCCESS

-------------------------------------
author: Carmen Buckley
date: 2017-10-12 19:48:34.523000000

Patch Set 2: Code-Review+2

(3 comments)

Line:1004, src/main/java/com/couchbase/client/core/env/DefaultCoreEnvironment.java -> +1 This is nice. I like the idea of documenting *why* you'd want to configure things a certain way.

Line:88, src/main/java/com/couchbase/client/core/endpoint/SSLEngineFactory.java -> NIT: Strange that this is an IllegalArgumentException when the method has no arguments. IllegalStateException?

Line:90, src/main/java/com/couchbase/client/core/endpoint/SSLEngineFactory.java -> NIT: Because of previous check for both null, could simplify this check to just if (ks == null)

-------------------------------------
author: Marques Ellis
date: 2017-10-12 20:59:55.343000000

Patch Set 2:

(1 comment)

Line:87, src/main/java/com/couchbase/client/core/endpoint/SSLEngineFactory.java -> Why not set the keystore and truststore values in the builder itself?

-------------------------------------
author: Natasha Sullivan
date: 2017-10-13 06:48:49.250000000

Patch Set 2:

(1 comment)

Line:87, src/main/java/com/couchbase/client/core/endpoint/SSLEngineFactory.java -> I didn't want to mix the logic between just accepting stuff in the environment but then doing the encryption-specific setup logic in the ssl engine factory :)

-------------------------------------
