| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 // If using TLS, wrap the socket in an SSL adapter. | 132 // If using TLS, wrap the socket in an SSL adapter. |
| 133 if (opts & PacketSocketFactory::OPT_TLS) { | 133 if (opts & PacketSocketFactory::OPT_TLS) { |
| 134 ASSERT(!(opts & PacketSocketFactory::OPT_SSLTCP)); | 134 ASSERT(!(opts & PacketSocketFactory::OPT_SSLTCP)); |
| 135 | 135 |
| 136 SSLAdapter* ssl_adapter = SSLAdapter::Create(socket); | 136 SSLAdapter* ssl_adapter = SSLAdapter::Create(socket); |
| 137 if (!ssl_adapter) { | 137 if (!ssl_adapter) { |
| 138 return NULL; | 138 return NULL; |
| 139 } | 139 } |
| 140 | 140 |
| 141 if (opts & PacketSocketFactory::OPT_INSECURE_CERT_CHECK) { |
| 142 ssl_adapter->set_ignore_bad_cert(true); |
| 143 } |
| 144 |
| 141 socket = ssl_adapter; | 145 socket = ssl_adapter; |
| 142 | 146 |
| 143 if (ssl_adapter->StartSSL(remote_address.hostname().c_str(), false) != 0) { | 147 if (ssl_adapter->StartSSL(remote_address.hostname().c_str(), false) != 0) { |
| 144 delete ssl_adapter; | 148 delete ssl_adapter; |
| 145 return NULL; | 149 return NULL; |
| 146 } | 150 } |
| 147 | 151 |
| 148 // If using SSLTCP, wrap the TCP socket in a pseudo-SSL socket. | 152 // If using SSLTCP, wrap the TCP socket in a pseudo-SSL socket. |
| 149 } else if (opts & PacketSocketFactory::OPT_SSLTCP) { | 153 } else if (opts & PacketSocketFactory::OPT_SSLTCP) { |
| 150 ASSERT(!(opts & PacketSocketFactory::OPT_TLS)); | 154 ASSERT(!(opts & PacketSocketFactory::OPT_TLS)); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 SocketFactory* BasicPacketSocketFactory::socket_factory() { | 201 SocketFactory* BasicPacketSocketFactory::socket_factory() { |
| 198 if (thread_) { | 202 if (thread_) { |
| 199 ASSERT(thread_ == Thread::Current()); | 203 ASSERT(thread_ == Thread::Current()); |
| 200 return thread_->socketserver(); | 204 return thread_->socketserver(); |
| 201 } else { | 205 } else { |
| 202 return socket_factory_; | 206 return socket_factory_; |
| 203 } | 207 } |
| 204 } | 208 } |
| 205 | 209 |
| 206 } // namespace rtc | 210 } // namespace rtc |
| OLD | NEW |