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

Side by Side Diff: remoting/jingle_glue/ssl_socket_adapter.cc

Issue 4339001: Correctly handle SSL Client Authentication requests when connecting... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: use HostPortPair instead of host,port Created 10 years, 1 month 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 #include "remoting/jingle_glue/ssl_socket_adapter.h" 5 #include "remoting/jingle_glue/ssl_socket_adapter.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "net/base/address_list.h" 9 #include "net/base/address_list.h"
10 #include "net/base/host_port_pair.h"
10 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
11 #include "net/base/ssl_config_service.h" 12 #include "net/base/ssl_config_service.h"
12 #include "net/base/sys_addrinfo.h" 13 #include "net/base/sys_addrinfo.h"
13 #include "net/socket/client_socket_factory.h" 14 #include "net/socket/client_socket_factory.h"
14 #include "net/url_request/url_request_context.h" 15 #include "net/url_request/url_request_context.h"
15 #include "remoting/jingle_glue/utils.h" 16 #include "remoting/jingle_glue/utils.h"
16 17
17 namespace remoting { 18 namespace remoting {
18 19
19 SSLSocketAdapter* SSLSocketAdapter::Create(AsyncSocket* socket) { 20 SSLSocketAdapter* SSLSocketAdapter::Create(AsyncSocket* socket) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return net::ERR_UNEXPECTED; 61 return net::ERR_UNEXPECTED;
61 } 62 }
62 63
63 // SSLConfigService is not thread-safe, and the default values for SSLConfig 64 // SSLConfigService is not thread-safe, and the default values for SSLConfig
64 // are correct for us, so we don't use the config service to initialize this 65 // are correct for us, so we don't use the config service to initialize this
65 // object. 66 // object.
66 net::SSLConfig ssl_config; 67 net::SSLConfig ssl_config;
67 transport_socket_->set_addr(talk_base::SocketAddress(hostname_, 0)); 68 transport_socket_->set_addr(talk_base::SocketAddress(hostname_, 0));
68 ssl_socket_.reset( 69 ssl_socket_.reset(
69 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( 70 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket(
70 transport_socket_, hostname_.c_str(), ssl_config, 71 transport_socket_, net::HostPortPair(hostname_, /*TODO(rch)*/443),
wtc 2010/11/12 00:12:55 I think you can remove the TODO comment. It shoul
Ryan Hamilton 2010/11/12 00:47:30 Done.
71 NULL /* ssl_host_info */)); 72 ssl_config, NULL /* ssl_host_info */));
72 73
73 int result = ssl_socket_->Connect(&connected_callback_); 74 int result = ssl_socket_->Connect(&connected_callback_);
74 75
75 if (result == net::ERR_IO_PENDING || result == net::OK) { 76 if (result == net::ERR_IO_PENDING || result == net::OK) {
76 return 0; 77 return 0;
77 } else { 78 } else {
78 LOG(ERROR) << "Could not start SSL: " << net::ErrorToString(result); 79 LOG(ERROR) << "Could not start SSL: " << net::ErrorToString(result);
79 return result; 80 return result;
80 } 81 }
81 } 82 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 write_buffer_len_ = buffer_len; 346 write_buffer_len_ = buffer_len;
346 return; 347 return;
347 } 348 }
348 } 349 }
349 was_used_to_convey_data_ = true; 350 was_used_to_convey_data_ = true;
350 callback->RunWithParams(Tuple1<int>(result)); 351 callback->RunWithParams(Tuple1<int>(result));
351 } 352 }
352 } 353 }
353 354
354 } // namespace remoting 355 } // namespace remoting
OLDNEW
« remoting/jingle_glue/ssl_socket_adapter.h ('K') | « remoting/jingle_glue/ssl_socket_adapter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698