How to set up and test "Trust System CA-Signed Certificates" trust strategy?


I tried to follow the instructions to set up a certificate on Neo4j server:

I am using Neo4j Java driver and setting the trust strategy as follows:
ConfigBuilder builder =;

An exception occurs:
org.neo4j.driver.v1.exceptions.SecurityException: Failed to establish secured connection with the server
Caused by: General SSLEngine problem
Caused by: PKIX path building failed: unable to find valid certification path to requested target

If I set the strategy to trust all, then it works fine. What could I have missed?