I build a Java Application for testing data on a Local Server. The server is using https to communicate. It has a self signed certificate and i added it to cacerts so my application knows that it will be accepted.
It works on my PC and some others perfectly fine, but one user gets this error:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I searched for this issue on internet a lot, but could find only some things to import the certificate into keystore via keytool. What i did. The problem is, that i cant import the certificates to each java runtime who uses my tool.
The main question is, if I build an artifact and use it on another PC which keystore will be asked if certificate is valid. The one I build it with or the one which is installed on the system of user. If the later, how can I assure that the certificate will be accepted.
(I don't want to use trust all methods etc. Only the one I want to)
I use Apache CloseableHttpClient and JDK 8.