Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1763)

Unified Diff: net/socket/ssl_client_socket_mac.cc

Issue 500018: Handle unexpected connection close during SSL handshake on Mac (Closed)
Patch Set: Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/cross_origin_xhr_apitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_mac.cc
diff --git a/net/socket/ssl_client_socket_mac.cc b/net/socket/ssl_client_socket_mac.cc
index 3aa3591dfe8b0b5667e4b466795ee4058c699dcf..1bf68a0cdbe2e40d43ec48ce952f7f52b9e4a2d7 100644
--- a/net/socket/ssl_client_socket_mac.cc
+++ b/net/socket/ssl_client_socket_mac.cc
@@ -710,6 +710,10 @@ int SSLClientSocketMac::DoHandshakeStart() {
}
}
+ if (status == errSSLClosedGraceful)
+ // The server unexpectedly closed on us.
+ return ERR_UNEXPECTED;
wtc 2009/12/16 00:48:52 Please add curly braces {} to this if statement be
+
int net_error = NetErrorFromOSStatus(status);
if (status == noErr || IsCertificateError(net_error)) {
server_cert_ = GetServerCert(ssl_context_);
@@ -765,6 +769,9 @@ int SSLClientSocketMac::DoHandshakeFinish() {
if (status == errSSLWouldBlock)
next_handshake_state_ = STATE_HANDSHAKE_FINISH;
+ if (status == errSSLClosedGraceful)
+ return ERR_UNEXPECTED;
wtc 2009/12/16 00:48:52 Same here: please use ERR_SSL_PROTOCOL_ERROR inste
+
if (status == noErr) {
completed_handshake_ = true;
DCHECK(next_handshake_state_ == STATE_NONE);
« no previous file with comments | « chrome/browser/extensions/cross_origin_xhr_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698