OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 ASSERT_TRUE(file_util::ReadFileToString(key_path, &key_string)); | 239 ASSERT_TRUE(file_util::ReadFileToString(key_path, &key_string)); |
240 std::vector<uint8> key_vector( | 240 std::vector<uint8> key_vector( |
241 reinterpret_cast<const uint8*>(key_string.data()), | 241 reinterpret_cast<const uint8*>(key_string.data()), |
242 reinterpret_cast<const uint8*>(key_string.data() + | 242 reinterpret_cast<const uint8*>(key_string.data() + |
243 key_string.length())); | 243 key_string.length())); |
244 | 244 |
245 scoped_ptr<crypto::RSAPrivateKey> private_key( | 245 scoped_ptr<crypto::RSAPrivateKey> private_key( |
246 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); | 246 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); |
247 | 247 |
248 net::SSLConfig ssl_config; | 248 net::SSLConfig ssl_config; |
| 249 ssl_config.cached_info_enabled = false; |
249 ssl_config.false_start_enabled = false; | 250 ssl_config.false_start_enabled = false; |
250 ssl_config.ssl3_enabled = true; | 251 ssl_config.ssl3_enabled = true; |
251 ssl_config.tls1_enabled = true; | 252 ssl_config.tls1_enabled = true; |
252 | 253 |
253 // Certificate provided by the host doesn't need authority. | 254 // Certificate provided by the host doesn't need authority. |
254 net::SSLConfig::CertAndStatus cert_and_status; | 255 net::SSLConfig::CertAndStatus cert_and_status; |
255 cert_and_status.cert_status = CERT_STATUS_AUTHORITY_INVALID; | 256 cert_and_status.cert_status = CERT_STATUS_AUTHORITY_INVALID; |
256 cert_and_status.cert = cert; | 257 cert_and_status.cert = cert; |
257 ssl_config.allowed_bad_certs.push_back(cert_and_status); | 258 ssl_config.allowed_bad_certs.push_back(cert_and_status); |
258 | 259 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 EXPECT_GT(read_callback.WaitForResult(), 0); | 367 EXPECT_GT(read_callback.WaitForResult(), 0); |
367 } | 368 } |
368 if (client_ret == net::ERR_IO_PENDING) { | 369 if (client_ret == net::ERR_IO_PENDING) { |
369 EXPECT_GT(write_callback.WaitForResult(), 0); | 370 EXPECT_GT(write_callback.WaitForResult(), 0); |
370 } | 371 } |
371 EXPECT_EQ(0, memcmp(write_buf->data(), read_buf->data(), write_buf->size())); | 372 EXPECT_EQ(0, memcmp(write_buf->data(), read_buf->data(), write_buf->size())); |
372 } | 373 } |
373 #endif | 374 #endif |
374 | 375 |
375 } // namespace net | 376 } // namespace net |
OLD | NEW |