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

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

Issue 135373002: Added SSLHostInfo. Storing of server host info to our standard disk cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with TOT Created 6 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) 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( 156 scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
157 scoped_ptr<StreamSocket> transport_socket, 157 scoped_ptr<StreamSocket> transport_socket,
158 const HostPortPair& host_and_port, 158 const HostPortPair& host_and_port,
159 const SSLConfig& ssl_config) { 159 const SSLConfig& ssl_config) {
160 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); 160 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
161 connection->SetSocket(transport_socket.Pass()); 161 connection->SetSocket(transport_socket.Pass());
162 return socket_factory_->CreateSSLClientSocket(connection.Pass(), 162 return socket_factory_->CreateSSLClientSocket(connection.Pass(),
163 host_and_port, 163 host_and_port,
164 ssl_config, 164 ssl_config,
165 NULL,
165 context_); 166 context_);
166 } 167 }
167 168
168 // Connect to a HTTPS test server. 169 // Connect to a HTTPS test server.
169 bool ConnectToTestServer(SpawnedTestServer::SSLOptions& ssl_options) { 170 bool ConnectToTestServer(SpawnedTestServer::SSLOptions& ssl_options) {
170 test_server_.reset(new SpawnedTestServer(SpawnedTestServer::TYPE_HTTPS, 171 test_server_.reset(new SpawnedTestServer(SpawnedTestServer::TYPE_HTTPS,
171 ssl_options, 172 ssl_options,
172 base::FilePath())); 173 base::FilePath()));
173 if (!test_server_->Start()) { 174 if (!test_server_->Start()) {
174 LOG(ERROR) << "Could not start SpawnedTestServer"; 175 LOG(ERROR) << "Could not start SpawnedTestServer";
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 357
357 int rv; 358 int rv;
358 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); 359 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
359 360
360 EXPECT_EQ(ERR_UNEXPECTED, rv); 361 EXPECT_EQ(ERR_UNEXPECTED, rv);
361 EXPECT_FALSE(sock_->IsConnected()); 362 EXPECT_FALSE(sock_->IsConnected());
362 } 363 }
363 364
364 } // namespace 365 } // namespace
365 } // namespace net 366 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698