CA-signed host certificate chain verification may fail
When using CA-signed host certificates with a PKI chain depth of 2 (leaf -> intermediate CA -> intermediate CA -> root CA), the client rejects the server certificate with message:
Certificate preverify failed.
Error is 22, 'certificate chain too long'.
SSL lib error '20' with reason '134'.
SSL error string 'certificate verify failed'.
Chains of depth 0 (leaf -> root) and depth 1 (leaf -> intermediate -> root) work correctly. Only depth >= 2 fails.
