PKIX path validation failed | subject/issuer name chaining check failed

I am developing an application that simulates the user's actions on a browser (logs in a site, do some POST's and GET's, etc) and I get the following error:

Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: subject/issuer name chaining check failed

...

Caused by: java.security.cert.CertPathValidatorException: subject/issuer name chaining check failed

I'm using Apache HTTP client library. Can someone explain to me what is wrong? I can do the same actions via a web browser.

[628 byte] By [mpinga] at [2007-10-3 10:46:14]
# 1
If someone is interested in the solution, i used a custom X509 certificate handler to solve it...
mpinga at 2007-7-15 6:10:39 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 2

Hi,

Yes, I am very interested in the solution. I would also like to know what the problem diagnosis was.

Was this issue only occurring on certain sites? Was your solution a workaround to a bug in Java, or are the browsers exhibiting lenient behavior for malformed certificate chains.

Thank you!

-Mark

m-turea at 2007-7-15 6:10:39 > top of Java-index,Security,Other Security APIs, Tools, and Issues...