When Implementing Java SDK the exception below occurs initializing the SplitFactory object:
RefreshableSplitFetcher failed: Problem fetching splitChanges: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
This exception means Java could not download the Split.io certificate, which will prevent the SSL connection to be established between the SDK and Split cloud.
Its possible to install the Split.io certificate manually into any Java store the JVM is using.
Here are the steps to download the Split.io certificate and add it:
1- Run the command below to fetch the cert:
openssl s_client -showcerts -connect split.io:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >splitcert.pem
2- Run the keytool to import the cert into Java cacerts store, or specify any other ket store:
keytool -importcert -file splitcert.pem -keystore [JAVA_HOME]/lib/security/cacerts -alias "splitcert"