How to handle BTS service certificate error


Summary:  

This article will give you the information to handle the certification error in BTS service.

Information:

Error message will be similar to

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Instructions to Install BT certificate

These instructions are for production Basware BTS (Business Transactions Sender) which is used to deliver documents to Basware BT (bt.basware.com).

To replace the certificate for this service you need to perform the following steps 

1. Stop Basware BTS service
2. Download certificate from this location: bt.basware.com.zip
3. Extract from Zip and place certificate to BTS installation folder\jre\bin
* Example path: C:\Program Files (x86)\Basware\BTS\jre\bin
4. Open command prompt and use mouse right click "Run as Administrator" when opening
5. Browse to BTS installation folder\jre\bin
* Example: C:\Program Files (x86)\Basware\BTS\jre\bin
6. Enter command: keytool -import -alias bt.basware.com -keystore BTS installation folder\jre\lib\security\cacerts -trustcacerts -file bt.basware.com.cer
* Example command with full path: keytool -import -alias bt.basware.com -keystore "C:\PROGRAM FILES\Basware\BTS\jre\lib\security\cacerts" -trustcacerts -file bt.basware.com.cer
* Note double quotes must be used if there are spaces in the path e.g. "C:\PROGRAM FILES\Basware\BTS\jre\lib\security\cacerts"
7. Enter password: changeit
8. Trust certificate: Yes
9. Start Basware BTS service

Troubleshooting

If you receive this error message at Step 6: keytool error: java.lang.Exception: Certificate not imported, alias <bt.basware.com> already exists

then run the following command to delete the existing certificate: keytool -delete -alias bt.basware.com -keystore BTS installation folder\jre\lib\security\cacerts

please then follow Step 6 again along with the remaining steps.

Security certificate with intermediate file: bt.basware.com_plus_int.zip