odpi / egeria-docs

Documentation repository for the Egeria project.
https://egeria-project.org
Other
23 stars 31 forks source link

SSL - configuration for non-egeria code ie connectors ie JDBC #613

Open planetf1 opened 2 years ago

planetf1 commented 2 years ago

When using the JDBC integration connector, the database connection may require the use of SSL.

In this case a variety of parameters may be set (see https://www.ibm.com/docs/en/db2/11.5?topic=SSEPGG_11.5.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052038.htm for DB2)

This will typically include certificate information - passwords, types etc, but crucially also PATHS on the local system to

planetf1 commented 2 years ago

I've been hitting issues even trying to make a 1 way SSL connect to a DB2 cloud service.

Whilst the handling of this particular situation is buggy (10 min timeout instead of immediate failure) by deep debugging, the failing stack is:

Screenshot 2022-11-30 at 11 58 36

I think what may be happening here is that when we launch the server chassis (from our assembly, or in our container) we point to a truststore that ONLY includes our certificate authority.

In my case I was making an SSL connection to a cloud DB2 server, which was returning a server cert signed by a certificate with a public train of trust. That would normally be resolved by the default system level root authority certs/chain (as it is in my standalone test code). However since our custom cert root does not contain these, validation of the server cert fails.

This same issue could affect ANY ssl connection made by the egeria server chassis.

The alternatives are:

planetf1 commented 2 years ago

(I think the hang is likely due to db2 driver seeing this as a potentially transient error)

planetf1 commented 2 years ago

Adding sslTrustStoreLocation=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/lib/security/cacerts; to the JDBC connection string resolved the issue for me -- of course that relies on the relevant CAs being defined there. It's also destination platform specific

At a minimum this needs explaining/docs to cover general cases as well as known examples, such as db2