Using TLS with IMAP, POP3 and ACAP:
http://www.ietf.org/rfc/rfc2595.txt
From page 2:
| 2.4. Server Identity Check
|
| During the TLS negotiation, the client MUST check its understanding
| of the server hostname against the server's identity as presented in
| the server Certificate message, in order to prevent man-in-the-middle
| attacks. Matching is performed according to these rules:
|
| - The client MUST use the server hostname it used to open the
| connection as the value to compare against the server name as
| expressed in the server certificate. The client MUST NOT use any
| form of the server hostname derived from an insecure remote source
| (e.g., insecure DNS lookup). CNAME canonicalization is not done.
Why does this work? Cannot someone send a wrong Certificate but with the
right hostname?
A.