Properly handle alerts from the peer in SSL_read.

We currently return 0 on them because OpenSSL returns 0 with an entry in the
error queue. (See bug.) This is completely insane, but it's how the API works
for now.

Add a test which causes the peer to return a fatal error. Extend
SSLClientSocketTest.Read to assert on the final exit code. This gives test
coverage for when the peer cleanly shuts down the connection.

BUG=466303

Review URL: https://codereview.chromium.org/994373004

Cr-Original-Commit-Position: refs/heads/master@{#321040}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e74aabdb96a388dd0f11c60552710fcfc6b86649
4 files changed