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

Unified Diff: net/socket/ssl_client_socket_pool.cc

Issue 1097773003: Clean up NPN/ALPN-related SSLClientSocket bits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rsleevi comment Created 5 years, 8 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 | « net/socket/ssl_client_socket_openssl.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_pool.cc
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index e6c770c6d8bc9f6afbd6a9ecad2dd8c8049c33e8..3426622756b9c657e8339416e74f0ad68ae99a51 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -329,33 +329,11 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
connect_timing_.ssl_end = base::TimeTicks::Now();
- SSLClientSocket::NextProtoStatus status =
- SSLClientSocket::kNextProtoUnsupported;
- std::string proto;
- // GetNextProto will fail and and trigger a NOTREACHED if we pass in a socket
- // that hasn't had SSL_ImportFD called on it. If we get a certificate error
- // here, then we know that we called SSL_ImportFD.
- if (result == OK || IsCertificateError(result)) {
- status = ssl_socket_->GetNextProto(&proto);
- ssl_socket_->RecordNegotiationExtension();
- }
-
- // If we want spdy over npn, make sure it succeeded.
- if (status == SSLClientSocket::kNextProtoNegotiated) {
- ssl_socket_->set_was_npn_negotiated(true);
- NextProto protocol_negotiated =
- SSLClientSocket::NextProtoFromString(proto);
- ssl_socket_->set_protocol_negotiated(protocol_negotiated);
- // If we negotiated a SPDY version, it must have been present in
- // SSLConfig::next_protos.
- // TODO(mbelshe): Verify this.
- if (protocol_negotiated >= kProtoSPDYMinimumVersion &&
- protocol_negotiated <= kProtoSPDYMaximumVersion) {
- ssl_socket_->set_was_spdy_negotiated(true);
- }
- }
- if (params_->want_spdy_over_npn() && !ssl_socket_->was_spdy_negotiated())
+ // If we want SPDY over ALPN/NPN, make sure it succeeded.
+ if (params_->want_spdy_over_npn() &&
+ !NextProtoIsSPDY(ssl_socket_->GetNegotiatedProtocol())) {
return ERR_NPN_NEGOTIATION_FAILED;
+ }
if (result == OK ||
ssl_socket_->IgnoreCertError(result, params_->load_flags())) {
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698