Skip to content
Advertisement

Unable to find valid certification path to requested target – error even after cert imported

I have a Java client trying to access a server with a self-signed certificate.

When I try to Post to the server, I get the following error:

unable to find valid certification path to requested target

Having done some research on the issue, I then did the following.

  1. Saved my servers domain name as a root.cer file.

  2. In my Glassfish server’s JRE, I ran this:

    JavaScript
  3. To check the cert was added to my cacert successfully, I did this:

    JavaScript

    I can see the cert is present.

  4. I then restarted Glassfish and retried the ‘post’.

I am still getting the same error.

I have a feeling this is because my Glassfish is not actually reading the cacert file that I have amended but maybe some other one.

Have any of you had this issue and can push me in the right direction?

Advertisement

Answer

Unfortunately – it could be many things – and lots of app servers and other java ‘wrappers’ are prone to play with properties and their ‘own’ take on keychains and what not. So it may be looking at something totally different.

Short of truss-ing – I’d try:

JavaScript

to see if that helps. Instead of ‘all’ one can also set it to ‘ssl’, key manager and trust manager – which may help in your case. Setting it to ‘help’ will list something like below on most platforms.

Regardless – do make sure you fully understand the difference between the keystore (in which you have the private key and cert you prove your own identity with) and the trust store (which determines who you trust) – and the fact that your own identity also has a ‘chain’ of trust to the root – which is separate from any chain to a root you need to figure out ‘who’ you trust.

JavaScript

Source: # See http://download.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#Debug

Advertisement