I was reading the "Security with HTTPS and SSL" guide for android developers and reading this paragraph.
The paragraph discusses the fact that servers do not always return the entire certificate chain during an SSL handshake, hey often return only the server certificate and the root CA of the chain. The chain are showed using openssl like: openssl s_client -connect egov.uscis.gov:443
This gave me some doubts:
The paragraph states that browsers, in order to manage this server configuration, simply cache intermediate CAs when visiting sites which are in servers giving a complete certificate chain and when they visit another site which is in a server giving only the "leaf" and "root" certificates they use the cached intermediate CA's certificates to follow the chain. But what happens if a browser visits a site which is in a server returning only the server and the "roots" certificates at a time in which the browser haven't still cached certificates of the intermediate CA's? An authentication error would be triggered?
How exactly does a browser follow the entire certification chain if it only receives the server and the root CA certificate? As far as I know the process is something like a recursive function which looks at the certificate signature, decrypt it, and checks if the result of the decryption coincides with the certificate of the current step. But, if only the server and the root CA certificates are gave, the process must stop with an error at the second passage, since (if more than one CA is involved in the certificate chain) the server certificate wasn't signed directly by the root CA...
I think I'm misunderstanding something in PKI verification procedure... Could you please clarify it to me and make me understand where I'm wrong?
------ EDIT
Thank you for the good answers, so you're telling me that when the article I linked states "it is not uncommon to configure a server to not include the necessary intermediate CA." it refers to the intermediate CA's certificates NOT INCLUDING the root CA right?