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

Side by Side Diff: net/socket/ssl_client_socket_unittest.cc

Issue 1387363004: Disable HTTP/2 over NPN (with OpenSSL). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable NPN in NSS if npn_protos.empty(). Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/ssl_client_socket.h" 5 #include "net/socket/ssl_client_socket.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 3122 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 3133
3134 TEST_F(SSLClientSocketFalseStartTest, FalseStartEnabled) { 3134 TEST_F(SSLClientSocketFalseStartTest, FalseStartEnabled) {
3135 // False Start requires NPN/ALPN, ECDHE, and an AEAD. 3135 // False Start requires NPN/ALPN, ECDHE, and an AEAD.
3136 SpawnedTestServer::SSLOptions server_options; 3136 SpawnedTestServer::SSLOptions server_options;
3137 server_options.key_exchanges = 3137 server_options.key_exchanges =
3138 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA; 3138 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA;
3139 server_options.bulk_ciphers = 3139 server_options.bulk_ciphers =
3140 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM; 3140 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM;
3141 server_options.npn_protocols.push_back(std::string("http/1.1")); 3141 server_options.npn_protocols.push_back(std::string("http/1.1"));
3142 SSLConfig client_config; 3142 SSLConfig client_config;
3143 client_config.next_protos.push_back(kProtoHTTP11); 3143 client_config.alpn_protos.push_back(kProtoHTTP11);
3144 client_config.npn_protos.push_back(kProtoHTTP11);
3144 ASSERT_NO_FATAL_FAILURE( 3145 ASSERT_NO_FATAL_FAILURE(
3145 TestFalseStart(server_options, client_config, true)); 3146 TestFalseStart(server_options, client_config, true));
3146 } 3147 }
3147 3148
3148 // Test that False Start is disabled without NPN. 3149 // Test that False Start is disabled without NPN.
3149 TEST_F(SSLClientSocketFalseStartTest, NoNPN) { 3150 TEST_F(SSLClientSocketFalseStartTest, NoNPN) {
3150 SpawnedTestServer::SSLOptions server_options; 3151 SpawnedTestServer::SSLOptions server_options;
3151 server_options.key_exchanges = 3152 server_options.key_exchanges =
3152 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA; 3153 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA;
3153 server_options.bulk_ciphers = 3154 server_options.bulk_ciphers =
3154 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM; 3155 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM;
3155 SSLConfig client_config; 3156 SSLConfig client_config;
3156 client_config.next_protos.clear(); 3157 client_config.alpn_protos.clear();
3158 client_config.npn_protos.clear();
3157 ASSERT_NO_FATAL_FAILURE( 3159 ASSERT_NO_FATAL_FAILURE(
3158 TestFalseStart(server_options, client_config, false)); 3160 TestFalseStart(server_options, client_config, false));
3159 } 3161 }
3160 3162
3161 // Test that False Start is disabled with plain RSA ciphers. 3163 // Test that False Start is disabled with plain RSA ciphers.
3162 TEST_F(SSLClientSocketFalseStartTest, RSA) { 3164 TEST_F(SSLClientSocketFalseStartTest, RSA) {
3163 SpawnedTestServer::SSLOptions server_options; 3165 SpawnedTestServer::SSLOptions server_options;
3164 server_options.key_exchanges = 3166 server_options.key_exchanges =
3165 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_RSA; 3167 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_RSA;
3166 server_options.bulk_ciphers = 3168 server_options.bulk_ciphers =
3167 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM; 3169 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM;
3168 server_options.npn_protocols.push_back(std::string("http/1.1")); 3170 server_options.npn_protocols.push_back(std::string("http/1.1"));
3169 SSLConfig client_config; 3171 SSLConfig client_config;
3170 client_config.next_protos.push_back(kProtoHTTP11); 3172 client_config.alpn_protos.push_back(kProtoHTTP11);
3173 client_config.npn_protos.push_back(kProtoHTTP11);
3171 ASSERT_NO_FATAL_FAILURE( 3174 ASSERT_NO_FATAL_FAILURE(
3172 TestFalseStart(server_options, client_config, false)); 3175 TestFalseStart(server_options, client_config, false));
3173 } 3176 }
3174 3177
3175 // Test that False Start is disabled with DHE_RSA ciphers. 3178 // Test that False Start is disabled with DHE_RSA ciphers.
3176 TEST_F(SSLClientSocketFalseStartTest, DHE_RSA) { 3179 TEST_F(SSLClientSocketFalseStartTest, DHE_RSA) {
3177 SpawnedTestServer::SSLOptions server_options; 3180 SpawnedTestServer::SSLOptions server_options;
3178 server_options.key_exchanges = 3181 server_options.key_exchanges =
3179 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_DHE_RSA; 3182 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_DHE_RSA;
3180 server_options.bulk_ciphers = 3183 server_options.bulk_ciphers =
3181 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM; 3184 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM;
3182 server_options.npn_protocols.push_back(std::string("http/1.1")); 3185 server_options.npn_protocols.push_back(std::string("http/1.1"));
3183 SSLConfig client_config; 3186 SSLConfig client_config;
3184 client_config.next_protos.push_back(kProtoHTTP11); 3187 client_config.alpn_protos.push_back(kProtoHTTP11);
3188 client_config.npn_protos.push_back(kProtoHTTP11);
3185 ASSERT_NO_FATAL_FAILURE(TestFalseStart(server_options, client_config, false)); 3189 ASSERT_NO_FATAL_FAILURE(TestFalseStart(server_options, client_config, false));
3186 } 3190 }
3187 3191
3188 // Test that False Start is disabled without an AEAD. 3192 // Test that False Start is disabled without an AEAD.
3189 TEST_F(SSLClientSocketFalseStartTest, NoAEAD) { 3193 TEST_F(SSLClientSocketFalseStartTest, NoAEAD) {
3190 SpawnedTestServer::SSLOptions server_options; 3194 SpawnedTestServer::SSLOptions server_options;
3191 server_options.key_exchanges = 3195 server_options.key_exchanges =
3192 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA; 3196 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA;
3193 server_options.bulk_ciphers = 3197 server_options.bulk_ciphers =
3194 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128; 3198 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128;
3195 server_options.npn_protocols.push_back(std::string("http/1.1")); 3199 server_options.npn_protocols.push_back(std::string("http/1.1"));
3196 SSLConfig client_config; 3200 SSLConfig client_config;
3197 client_config.next_protos.push_back(kProtoHTTP11); 3201 client_config.alpn_protos.push_back(kProtoHTTP11);
3202 client_config.npn_protos.push_back(kProtoHTTP11);
3198 ASSERT_NO_FATAL_FAILURE(TestFalseStart(server_options, client_config, false)); 3203 ASSERT_NO_FATAL_FAILURE(TestFalseStart(server_options, client_config, false));
3199 } 3204 }
3200 3205
3201 // Test that sessions are resumable after receiving the server Finished message. 3206 // Test that sessions are resumable after receiving the server Finished message.
3202 TEST_F(SSLClientSocketFalseStartTest, SessionResumption) { 3207 TEST_F(SSLClientSocketFalseStartTest, SessionResumption) {
3203 // Start a server. 3208 // Start a server.
3204 SpawnedTestServer::SSLOptions server_options; 3209 SpawnedTestServer::SSLOptions server_options;
3205 server_options.key_exchanges = 3210 server_options.key_exchanges =
3206 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA; 3211 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA;
3207 server_options.bulk_ciphers = 3212 server_options.bulk_ciphers =
3208 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM; 3213 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM;
3209 server_options.npn_protocols.push_back(std::string("http/1.1")); 3214 server_options.npn_protocols.push_back(std::string("http/1.1"));
3210 SSLConfig client_config; 3215 SSLConfig client_config;
3211 client_config.next_protos.push_back(kProtoHTTP11); 3216 client_config.alpn_protos.push_back(kProtoHTTP11);
3217 client_config.npn_protos.push_back(kProtoHTTP11);
3212 3218
3213 // Let a full handshake complete with False Start. 3219 // Let a full handshake complete with False Start.
3214 ASSERT_NO_FATAL_FAILURE( 3220 ASSERT_NO_FATAL_FAILURE(
3215 TestFalseStart(server_options, client_config, true)); 3221 TestFalseStart(server_options, client_config, true));
3216 3222
3217 // Make a second connection. 3223 // Make a second connection.
3218 TestCompletionCallback callback; 3224 TestCompletionCallback callback;
3219 scoped_ptr<StreamSocket> transport2( 3225 scoped_ptr<StreamSocket> transport2(
3220 new TCPClientSocket(addr(), &log_, NetLog::Source())); 3226 new TCPClientSocket(addr(), &log_, NetLog::Source()));
3221 EXPECT_EQ(OK, callback.GetResult(transport2->Connect(callback.callback()))); 3227 EXPECT_EQ(OK, callback.GetResult(transport2->Connect(callback.callback())));
(...skipping 14 matching lines...) Expand all
3236 // Start a server. 3242 // Start a server.
3237 SpawnedTestServer::SSLOptions server_options; 3243 SpawnedTestServer::SSLOptions server_options;
3238 server_options.key_exchanges = 3244 server_options.key_exchanges =
3239 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA; 3245 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA;
3240 server_options.bulk_ciphers = 3246 server_options.bulk_ciphers =
3241 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM; 3247 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM;
3242 server_options.npn_protocols.push_back(std::string("http/1.1")); 3248 server_options.npn_protocols.push_back(std::string("http/1.1"));
3243 ASSERT_TRUE(StartTestServer(server_options)); 3249 ASSERT_TRUE(StartTestServer(server_options));
3244 3250
3245 SSLConfig client_config; 3251 SSLConfig client_config;
3246 client_config.next_protos.push_back(kProtoHTTP11); 3252 client_config.alpn_protos.push_back(kProtoHTTP11);
3253 client_config.npn_protos.push_back(kProtoHTTP11);
3247 3254
3248 // Start a handshake up to the server Finished message. 3255 // Start a handshake up to the server Finished message.
3249 TestCompletionCallback callback; 3256 TestCompletionCallback callback;
3250 FakeBlockingStreamSocket* raw_transport1 = NULL; 3257 FakeBlockingStreamSocket* raw_transport1 = NULL;
3251 scoped_ptr<SSLClientSocket> sock1; 3258 scoped_ptr<SSLClientSocket> sock1;
3252 ASSERT_NO_FATAL_FAILURE(CreateAndConnectUntilServerFinishedReceived( 3259 ASSERT_NO_FATAL_FAILURE(CreateAndConnectUntilServerFinishedReceived(
3253 client_config, &callback, &raw_transport1, &sock1)); 3260 client_config, &callback, &raw_transport1, &sock1));
3254 // Although raw_transport1 has the server Finished blocked, the handshake 3261 // Although raw_transport1 has the server Finished blocked, the handshake
3255 // still completes. 3262 // still completes.
3256 EXPECT_EQ(OK, callback.WaitForResult()); 3263 EXPECT_EQ(OK, callback.WaitForResult());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
3294 // Start a server. 3301 // Start a server.
3295 SpawnedTestServer::SSLOptions server_options; 3302 SpawnedTestServer::SSLOptions server_options;
3296 server_options.key_exchanges = 3303 server_options.key_exchanges =
3297 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA; 3304 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_ECDHE_RSA;
3298 server_options.bulk_ciphers = 3305 server_options.bulk_ciphers =
3299 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM; 3306 SpawnedTestServer::SSLOptions::BULK_CIPHER_AES128GCM;
3300 server_options.npn_protocols.push_back(std::string("http/1.1")); 3307 server_options.npn_protocols.push_back(std::string("http/1.1"));
3301 ASSERT_TRUE(StartTestServer(server_options)); 3308 ASSERT_TRUE(StartTestServer(server_options));
3302 3309
3303 SSLConfig client_config; 3310 SSLConfig client_config;
3304 client_config.next_protos.push_back(kProtoHTTP11); 3311 client_config.alpn_protos.push_back(kProtoHTTP11);
3312 client_config.npn_protos.push_back(kProtoHTTP11);
3305 3313
3306 // Start a handshake up to the server Finished message. 3314 // Start a handshake up to the server Finished message.
3307 TestCompletionCallback callback; 3315 TestCompletionCallback callback;
3308 FakeBlockingStreamSocket* raw_transport1 = NULL; 3316 FakeBlockingStreamSocket* raw_transport1 = NULL;
3309 scoped_ptr<SSLClientSocket> sock1; 3317 scoped_ptr<SSLClientSocket> sock1;
3310 ASSERT_NO_FATAL_FAILURE(CreateAndConnectUntilServerFinishedReceived( 3318 ASSERT_NO_FATAL_FAILURE(CreateAndConnectUntilServerFinishedReceived(
3311 client_config, &callback, &raw_transport1, &sock1)); 3319 client_config, &callback, &raw_transport1, &sock1));
3312 // Although raw_transport1 has the server Finished blocked, the handshake 3320 // Although raw_transport1 has the server Finished blocked, the handshake
3313 // still completes. 3321 // still completes.
3314 EXPECT_EQ(OK, callback.WaitForResult()); 3322 EXPECT_EQ(OK, callback.WaitForResult());
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
3411 SSLConfig ssl_config; 3419 SSLConfig ssl_config;
3412 ssl_config.channel_id_enabled = true; 3420 ssl_config.channel_id_enabled = true;
3413 3421
3414 int rv; 3422 int rv;
3415 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); 3423 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
3416 3424
3417 EXPECT_EQ(ERR_UNEXPECTED, rv); 3425 EXPECT_EQ(ERR_UNEXPECTED, rv);
3418 EXPECT_FALSE(sock_->IsConnected()); 3426 EXPECT_FALSE(sock_->IsConnected());
3419 } 3427 }
3420 3428
3429 // Because of quirks of the NSS implementation, in the following NPN tests,
3430 // client_config.alpn_protos needs to be set, because NSS uses it for NPN (it
3431 // has to use the same string as for ALPN), and client_config.npn_protos needs
3432 // to be non-empty, otherwise NSS disables NPN.
davidben 2015/10/13 20:55:59 Optional: Wrap the alpn_protos bits under #ifdef t
Bence 2015/10/14 14:55:59 Done.
3433
3421 TEST_F(SSLClientSocketTest, NPN) { 3434 TEST_F(SSLClientSocketTest, NPN) {
3422 SpawnedTestServer::SSLOptions server_options; 3435 SpawnedTestServer::SSLOptions server_options;
3423 server_options.npn_protocols.push_back(std::string("spdy/3.1")); 3436 server_options.npn_protocols.push_back(std::string("spdy/3.1"));
3424 server_options.npn_protocols.push_back(std::string("h2")); 3437 server_options.npn_protocols.push_back(std::string("h2"));
3425 ASSERT_TRUE(ConnectToTestServer(server_options)); 3438 ASSERT_TRUE(ConnectToTestServer(server_options));
3426 3439
3427 SSLConfig client_config; 3440 SSLConfig client_config;
3428 client_config.next_protos.push_back(kProtoHTTP2); 3441 client_config.alpn_protos.push_back(kProtoHTTP2);
3429 client_config.next_protos.push_back(kProtoHTTP11); 3442 client_config.alpn_protos.push_back(kProtoHTTP11);
3443 client_config.npn_protos.push_back(kProtoHTTP2);
3444 client_config.npn_protos.push_back(kProtoHTTP11);
3430 3445
3431 int rv; 3446 int rv;
3432 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv)); 3447 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv));
3433 EXPECT_EQ(OK, rv); 3448 EXPECT_EQ(OK, rv);
3434 3449
3435 std::string proto; 3450 std::string proto;
3436 EXPECT_EQ(SSLClientSocket::kNextProtoNegotiated, sock_->GetNextProto(&proto)); 3451 EXPECT_EQ(SSLClientSocket::kNextProtoNegotiated, sock_->GetNextProto(&proto));
3437 EXPECT_EQ("h2", proto); 3452 EXPECT_EQ("h2", proto);
3438 } 3453 }
3439 3454
3440 // In case of no overlap between client and server list, SSLClientSocket should 3455 // In case of no overlap between client and server list, SSLClientSocket should
3441 // fall back to last one on the client list. 3456 // fall back to last one on the client list.
3442 TEST_F(SSLClientSocketTest, NPNNoOverlap) { 3457 TEST_F(SSLClientSocketTest, NPNNoOverlap) {
3443 SpawnedTestServer::SSLOptions server_options; 3458 SpawnedTestServer::SSLOptions server_options;
3444 server_options.npn_protocols.push_back(std::string("http/1.1")); 3459 server_options.npn_protocols.push_back(std::string("http/1.1"));
3445 ASSERT_TRUE(ConnectToTestServer(server_options)); 3460 ASSERT_TRUE(ConnectToTestServer(server_options));
3446 3461
3447 SSLConfig client_config; 3462 SSLConfig client_config;
3448 client_config.next_protos.push_back(kProtoSPDY31); 3463 client_config.alpn_protos.push_back(kProtoSPDY31);
3449 client_config.next_protos.push_back(kProtoHTTP2); 3464 client_config.alpn_protos.push_back(kProtoHTTP2);
3465 client_config.npn_protos.push_back(kProtoSPDY31);
3466 client_config.npn_protos.push_back(kProtoHTTP2);
3450 3467
3451 int rv; 3468 int rv;
3452 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv)); 3469 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv));
3453 EXPECT_EQ(OK, rv); 3470 EXPECT_EQ(OK, rv);
3454 3471
3455 std::string proto; 3472 std::string proto;
3456 EXPECT_EQ(SSLClientSocket::kNextProtoNoOverlap, sock_->GetNextProto(&proto)); 3473 EXPECT_EQ(SSLClientSocket::kNextProtoNoOverlap, sock_->GetNextProto(&proto));
3457 EXPECT_EQ("h2", proto); 3474 EXPECT_EQ("h2", proto);
3458 } 3475 }
3459 3476
3460 // Server preference should be respected. The list is in decreasing order of 3477 // Server preference should be respected. The list is in decreasing order of
3461 // preference. 3478 // preference.
3462 TEST_F(SSLClientSocketTest, NPNServerPreference) { 3479 TEST_F(SSLClientSocketTest, NPNServerPreference) {
3463 SpawnedTestServer::SSLOptions server_options; 3480 SpawnedTestServer::SSLOptions server_options;
3464 server_options.npn_protocols.push_back(std::string("spdy/3.1")); 3481 server_options.npn_protocols.push_back(std::string("spdy/3.1"));
3465 server_options.npn_protocols.push_back(std::string("h2")); 3482 server_options.npn_protocols.push_back(std::string("h2"));
3466 ASSERT_TRUE(ConnectToTestServer(server_options)); 3483 ASSERT_TRUE(ConnectToTestServer(server_options));
3467 3484
3468 SSLConfig client_config; 3485 SSLConfig client_config;
3469 client_config.next_protos.push_back(kProtoHTTP2); 3486 client_config.alpn_protos.push_back(kProtoHTTP2);
3470 client_config.next_protos.push_back(kProtoSPDY31); 3487 client_config.alpn_protos.push_back(kProtoSPDY31);
3488 client_config.npn_protos.push_back(kProtoHTTP2);
3489 client_config.npn_protos.push_back(kProtoSPDY31);
3471 3490
3472 int rv; 3491 int rv;
3473 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv)); 3492 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv));
3474 EXPECT_EQ(OK, rv); 3493 EXPECT_EQ(OK, rv);
3475 3494
3476 std::string proto; 3495 std::string proto;
3477 EXPECT_EQ(SSLClientSocket::kNextProtoNegotiated, sock_->GetNextProto(&proto)); 3496 EXPECT_EQ(SSLClientSocket::kNextProtoNegotiated, sock_->GetNextProto(&proto));
3478 EXPECT_EQ("spdy/3.1", proto); 3497 EXPECT_EQ("spdy/3.1", proto);
3479 } 3498 }
3480 3499
(...skipping 11 matching lines...) Expand all
3492 std::string proto; 3511 std::string proto;
3493 EXPECT_EQ(SSLClientSocket::kNextProtoUnsupported, 3512 EXPECT_EQ(SSLClientSocket::kNextProtoUnsupported,
3494 sock_->GetNextProto(&proto)); 3513 sock_->GetNextProto(&proto));
3495 } 3514 }
3496 3515
3497 TEST_F(SSLClientSocketTest, NPNServerDisabled) { 3516 TEST_F(SSLClientSocketTest, NPNServerDisabled) {
3498 SpawnedTestServer::SSLOptions server_options; 3517 SpawnedTestServer::SSLOptions server_options;
3499 ASSERT_TRUE(ConnectToTestServer(server_options)); 3518 ASSERT_TRUE(ConnectToTestServer(server_options));
3500 3519
3501 SSLConfig client_config; 3520 SSLConfig client_config;
3502 client_config.next_protos.push_back(kProtoHTTP11); 3521 client_config.alpn_protos.push_back(kProtoHTTP11);
3522 client_config.npn_protos.push_back(kProtoHTTP11);
3503 3523
3504 int rv; 3524 int rv;
3505 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv)); 3525 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv));
3506 EXPECT_EQ(OK, rv); 3526 EXPECT_EQ(OK, rv);
3507 3527
3508 std::string proto; 3528 std::string proto;
3509 EXPECT_EQ(SSLClientSocket::kNextProtoUnsupported, 3529 EXPECT_EQ(SSLClientSocket::kNextProtoUnsupported,
3510 sock_->GetNextProto(&proto)); 3530 sock_->GetNextProto(&proto));
3511 } 3531 }
3512 3532
3513 } // namespace net 3533 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698