Exception in thread "main" 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 targetYour truststore doesn't trust the server certificate.
Akmal wrote:For this you require to run a program and do the handsahking with the server (Mean checks does your truststore has the server certificate in it or not, if not, then copies the server certificate to your truststore), For this search on google for java program.
i have an idea about it but problem is but i do not know what step should be taken to resolve it kindly tell me what should i do to resolve it
thanks and regards,
my problem i want to disabling Certificate ValidationNo you don't. That's just a poor tactical solution to your real problem, which is how to trust the server certificate. SSL without authentication isn't secure. You don't want to do this, you want to solve the original problem.
and now i am using this codePlease don't. It is insecure. You need to import the server's certificate into your client's truststore. Better still, get them to get their certificate signed by a trusted certificate authority.
Exception in thread "main" java.net.ConnectException: Connection refused: connectThe server isn't listening at that IP:port.
Akmal wrote:Typically you use the keytool utility (http://download.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html). Here is a thought, a few threads above you were trying to disable certificate validation, if security is not that big a concern for you and if you feel that certificate management is tough (which it is), maybe you should consider a non-ssl connection?
Thanks for suggestion and kindly tell me how to import server’s certificate into my client’s truststore I have no right on server, or refer such web site from there I can read about this that should be well explain because I am new in this type programming
Kindly help me I am great problem
Thanks and regards,