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

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

Issue 6370008: Enable session resumption in SSLServerSocketNSS and unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This test suite uses SSLClientSocket to test the implementation of 5 // This test suite uses SSLClientSocket to test the implementation of
6 // SSLServerSocket. In order to establish connections between the sockets 6 // SSLServerSocket. In order to establish connections between the sockets
7 // we need two additional classes: 7 // we need two additional classes:
8 // 1. FakeSocket 8 // 1. FakeSocket
9 // Connects SSL socket to FakeDataChannel. This class is just a stub. 9 // Connects SSL socket to FakeDataChannel. This class is just a stub.
10 // 10 //
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 key_string.length())); 234 key_string.length()));
235 235
236 scoped_ptr<base::RSAPrivateKey> private_key( 236 scoped_ptr<base::RSAPrivateKey> private_key(
237 base::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); 237 base::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector));
238 238
239 net::SSLConfig ssl_config; 239 net::SSLConfig ssl_config;
240 ssl_config.false_start_enabled = false; 240 ssl_config.false_start_enabled = false;
241 ssl_config.snap_start_enabled = false; 241 ssl_config.snap_start_enabled = false;
242 ssl_config.ssl3_enabled = true; 242 ssl_config.ssl3_enabled = true;
243 ssl_config.tls1_enabled = true; 243 ssl_config.tls1_enabled = true;
244 ssl_config.session_resume_disabled = true;
245 244
246 // Certificate provided by the host doesn't need authority. 245 // Certificate provided by the host doesn't need authority.
247 net::SSLConfig::CertAndStatus cert_and_status; 246 net::SSLConfig::CertAndStatus cert_and_status;
248 cert_and_status.cert_status = net::ERR_CERT_AUTHORITY_INVALID; 247 cert_and_status.cert_status = net::ERR_CERT_AUTHORITY_INVALID;
249 cert_and_status.cert = cert; 248 cert_and_status.cert = cert;
250 ssl_config.allowed_bad_certs.push_back(cert_and_status); 249 ssl_config.allowed_bad_certs.push_back(cert_and_status);
251 250
252 net::HostPortPair host_and_pair("unittest", 0); 251 net::HostPortPair host_and_pair("unittest", 0);
253 client_socket_.reset( 252 client_socket_.reset(
254 socket_factory_->CreateSSLClientSocket( 253 socket_factory_->CreateSSLClientSocket(
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 EXPECT_GT(read_callback.WaitForResult(), 0); 353 EXPECT_GT(read_callback.WaitForResult(), 0);
355 } 354 }
356 if (client_ret == net::ERR_IO_PENDING) { 355 if (client_ret == net::ERR_IO_PENDING) {
357 EXPECT_GT(write_callback.WaitForResult(), 0); 356 EXPECT_GT(write_callback.WaitForResult(), 0);
358 } 357 }
359 EXPECT_EQ(0, memcmp(write_buf->data(), read_buf->data(), write_buf->size())); 358 EXPECT_EQ(0, memcmp(write_buf->data(), read_buf->data(), write_buf->size()));
360 } 359 }
361 #endif 360 #endif
362 361
363 } // namespace net 362 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698