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

Unified Diff: net/base/ssl_client_socket_nss.cc

Issue 131085: Linux: Fallback to SSL if server closes early during TLS handshake. (Closed)
Patch Set: Add braces. Created 11 years, 6 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/ssl_client_socket_nss.cc
diff --git a/net/base/ssl_client_socket_nss.cc b/net/base/ssl_client_socket_nss.cc
index d64d791d909d06f880674c4c06f85484e01dbc1f..c48f0b06e2d2fd57500c725f2f08d75bb89e980a 100644
--- a/net/base/ssl_client_socket_nss.cc
+++ b/net/base/ssl_client_socket_nss.cc
@@ -691,7 +691,14 @@ int SSLClientSocketNSS::DoHandshakeRead() {
// Done!
} else {
PRErrorCode prerr = PR_GetError();
- net_error = NetErrorFromNSPRError(prerr);
+
+ // If the server closed on us, it is a protocol error.
+ // Some TLS-intolerant servers do this when we request TLS.
+ if (prerr == PR_END_OF_FILE_ERROR) {
+ net_error = ERR_SSL_PROTOCOL_ERROR;
+ } else {
+ net_error = NetErrorFromNSPRError(prerr);
+ }
// If not done, stay in this state
if (net_error == ERR_IO_PENDING) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698