title: SSL chain validation failed with intermediate cert
body: <p>I want to understand the way the validation chain works. What certs do I really need in my truststore?</p>
  
  <p>I have a chain with
  Root CA -> intermediate 1 -> intermediate 2 -> server cert.
  I have only the intermediate 2 cert in my truststore. On my one test machine this works all right, but on my other it does not (contacting a different server with similar configuration). I get this popular SunCertPathBuilderException: unable to find valid certification path to requested target Exception. The server sends the full chain.
  I guess the solution will be to put the whole chain up to Root CA to my truststore.</p>
  
  <p>I want to know why it works on one machine and not the other. Is it possible to have influence on how chain validation works? Can a server require full chain validation?</p>
  
  <p>I could not figure out, if the default truststore from jdk is automatically included or not. The 2 machines have slightly different jdk versions 1.7.0_21 (not working) and 1.7.0_25 (working). Does it matter?</p>
  
  <p>One more thing: this SunCertPathBuilderException - is it possible to find out which part of the chain he does not like?</p>
  
  <p>I am happy for any hints.
  Thanks, Heike</p>