libchromeos: Enable remote host validation during TLS handshake

In order to provide higher security, ensure that the server certificate
that comes from the remote host we are connecting to via TLS matches the
host name we expect. If not, TLS connection will be terminated immediately.

BUG=brillo:1050
TEST=`FEATURES=test emerge-link libchromeos`
     Verified on the device using secure XMPP connection to talk.google.com
     Also tried spoofing the expected domain name and verified that the
     TLS handshake was aborted.

Change-Id: I3dde9c1ecb74327acddcccb62afabe858700ddb4
Reviewed-on: https://chromium-review.googlesource.com/273349
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
1 file changed