Issue:
The Tetherfi Generic Web Service Interface component result in certificate error upon calling host modules.
"Exception at GenericHttpRequestBuilder:sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target".
Description:
in the case if you are calling any host module API either from Module Engine/NextAction or Module Designer Host Simulation feature, the tetherfi generic web service interface is throwing the certificate path error as response and the host api execution fails.
Troubleshooting Check-points:
Check point 1: Verify the JKS and key store has valid certificate
- In the Module Designer UI, you can find the 'SSL Manager' option.
- Open the same and verify all the paths provided, also check the jks file exists in the specified path.
- Click on the 'Certificate Manager' feature in Module Designer(MD), check if the certificate you are looking for is loaded, validate the certificate using keytool.
Check point 2: check JVM cacerts
- In some of the cases the Java security under jvm could not identify the certificate your loaded.
- Navigate to the JDK installed(usually program files/Java/) then /lib/security you will find 'cacerts' keystore.
- in the command prompt , you can list the cert and verify the certificate in the keystore cacerts.
Resolutions/Cause:
- In certificate path , additional white spaces, special characters and permissions to the certificate folder location would cause the error.
- Importing the certificate to the JVM security, steps as follows
- Place the valid .cer certificate in accessible location
- Now you have file with key store and you have to add it to your JVM. Determine location of cacerts files eg. C:\Program Files\Java\jre1.6.0_22\lib\security\cacerts
- Next import the .cer file into cacerts in command line (may need administrator command prompt)
keytool -import -alias example -keystore "C:\Program Files (x86)\Java\jre1.6.0_22\lib\security\cacerts" -file example.cer - You will be asked for password which default is 'changeit'
- Restart the JVM/PC/Server.