| OLD | NEW |
| 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/host_port_pair.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 // SSLConfigService is not thread-safe, and the default values for SSLConfig | 64 // SSLConfigService is not thread-safe, and the default values for SSLConfig |
| 65 // 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 |
| 66 // object. | 66 // object. |
| 67 net::SSLConfig ssl_config; | 67 net::SSLConfig ssl_config; |
| 68 transport_socket_->set_addr(talk_base::SocketAddress(hostname_, 0)); | 68 transport_socket_->set_addr(talk_base::SocketAddress(hostname_, 0)); |
| 69 ssl_socket_.reset( | 69 ssl_socket_.reset( |
| 70 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( | 70 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( |
| 71 transport_socket_, net::HostPortPair(hostname_, 443), ssl_config, | 71 transport_socket_, net::HostPortPair(hostname_, 443), ssl_config, |
| 72 NULL /* ssl_host_info */)); | 72 NULL /* ssl_host_info */, |
| 73 NULL /* TODO(wtc): cert_verifier */)); |
| 73 | 74 |
| 74 int result = ssl_socket_->Connect(&connected_callback_); | 75 int result = ssl_socket_->Connect(&connected_callback_); |
| 75 | 76 |
| 76 if (result == net::ERR_IO_PENDING || result == net::OK) { | 77 if (result == net::ERR_IO_PENDING || result == net::OK) { |
| 77 return 0; | 78 return 0; |
| 78 } else { | 79 } else { |
| 79 LOG(ERROR) << "Could not start SSL: " << net::ErrorToString(result); | 80 LOG(ERROR) << "Could not start SSL: " << net::ErrorToString(result); |
| 80 return result; | 81 return result; |
| 81 } | 82 } |
| 82 } | 83 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 write_buffer_len_ = buffer_len; | 351 write_buffer_len_ = buffer_len; |
| 351 return; | 352 return; |
| 352 } | 353 } |
| 353 } | 354 } |
| 354 was_used_to_convey_data_ = true; | 355 was_used_to_convey_data_ = true; |
| 355 callback->RunWithParams(Tuple1<int>(result)); | 356 callback->RunWithParams(Tuple1<int>(result)); |
| 356 } | 357 } |
| 357 } | 358 } |
| 358 | 359 |
| 359 } // namespace remoting | 360 } // namespace remoting |
| OLD | NEW |