| OLD | NEW |
| 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 <errno.h> | 7 #include <errno.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <openssl/bio.h> | 10 #include <openssl/bio.h> |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 virtual ~SSLClientSocketOpenSSLClientAuthTest() { | 105 virtual ~SSLClientSocketOpenSSLClientAuthTest() { |
| 106 key_store_->Flush(); | 106 key_store_->Flush(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 protected: | 109 protected: |
| 110 SSLClientSocket* CreateSSLClientSocket( | 110 SSLClientSocket* CreateSSLClientSocket( |
| 111 StreamSocket* transport_socket, | 111 StreamSocket* transport_socket, |
| 112 const HostPortPair& host_and_port, | 112 const HostPortPair& host_and_port, |
| 113 const SSLConfig& ssl_config) { | 113 const SSLConfig& ssl_config) { |
| 114 return socket_factory_->CreateSSLClientSocket(transport_socket, | 114 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); |
| 115 connection->set_socket(transport_socket); |
| 116 return socket_factory_->CreateSSLClientSocket(connection.release(), |
| 115 host_and_port, | 117 host_and_port, |
| 116 ssl_config, | 118 ssl_config, |
| 117 context_); | 119 context_); |
| 118 } | 120 } |
| 119 | 121 |
| 120 // Connect to a HTTPS test server. | 122 // Connect to a HTTPS test server. |
| 121 bool ConnectToTestServer(SpawnedTestServer::SSLOptions& ssl_options) { | 123 bool ConnectToTestServer(SpawnedTestServer::SSLOptions& ssl_options) { |
| 122 test_server_.reset(new SpawnedTestServer(SpawnedTestServer::TYPE_HTTPS, | 124 test_server_.reset(new SpawnedTestServer(SpawnedTestServer::TYPE_HTTPS, |
| 123 ssl_options, | 125 ssl_options, |
| 124 base::FilePath())); | 126 base::FilePath())); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 EXPECT_TRUE(sock_->IsConnected()); | 270 EXPECT_TRUE(sock_->IsConnected()); |
| 269 | 271 |
| 270 EXPECT_TRUE(CheckSSLClientSocketSentCert()); | 272 EXPECT_TRUE(CheckSSLClientSocketSentCert()); |
| 271 | 273 |
| 272 sock_->Disconnect(); | 274 sock_->Disconnect(); |
| 273 EXPECT_FALSE(sock_->IsConnected()); | 275 EXPECT_FALSE(sock_->IsConnected()); |
| 274 } | 276 } |
| 275 | 277 |
| 276 } // namespace | 278 } // namespace |
| 277 } // namespace net | 279 } // namespace net |
| OLD | NEW |