I have developed two simple java programs : a SSL client and a SSL server which have to communicate on a LAN, with a one-way authentication.
Right now I am running the client and the server on the same computer.
My questions are about certificates :
I've managed to create a .jks
and .crt
thanks to the keytool in jdk\bin
.
In server.java
:
myKeyStore.load(new FileInputStream(keyStoreName), keyStorePassword);
... and I don't know how import the certificate inside the client.
When I tried to run both this is what I got on the client side:
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
...
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target