OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 if (server_address_.proto == PROTO_UDP && !SharedSocket()) { | 322 if (server_address_.proto == PROTO_UDP && !SharedSocket()) { |
323 socket_ = socket_factory()->CreateUdpSocket( | 323 socket_ = socket_factory()->CreateUdpSocket( |
324 rtc::SocketAddress(ip(), 0), min_port(), max_port()); | 324 rtc::SocketAddress(ip(), 0), min_port(), max_port()); |
325 } else if (server_address_.proto == PROTO_TCP || | 325 } else if (server_address_.proto == PROTO_TCP || |
326 server_address_.proto == PROTO_TLS) { | 326 server_address_.proto == PROTO_TLS) { |
327 ASSERT(!SharedSocket()); | 327 ASSERT(!SharedSocket()); |
328 int opts = rtc::PacketSocketFactory::OPT_STUN; | 328 int opts = rtc::PacketSocketFactory::OPT_STUN; |
329 | 329 |
330 // Apply server address TLS and insecure bits to options. | 330 // Apply server address TLS and insecure bits to options. |
331 if (server_address_.proto == PROTO_TLS) { | 331 if (server_address_.proto == PROTO_TLS) { |
332 opts |= rtc::PacketSocketFactory::OPT_TLS; | 332 if (tls_cert_policy_ == |
| 333 TlsCertPolicy::TLS_CERT_POLICY_INSECURE_NO_CHECK) { |
| 334 opts |= rtc::PacketSocketFactory::OPT_TLS_INSECURE; |
| 335 } else { |
| 336 opts |= rtc::PacketSocketFactory::OPT_TLS; |
| 337 } |
333 } | 338 } |
| 339 |
334 socket_ = socket_factory()->CreateClientTcpSocket( | 340 socket_ = socket_factory()->CreateClientTcpSocket( |
335 rtc::SocketAddress(ip(), 0), server_address_.address, | 341 rtc::SocketAddress(ip(), 0), server_address_.address, |
336 proxy(), user_agent(), opts); | 342 proxy(), user_agent(), opts); |
337 } | 343 } |
338 | 344 |
339 if (!socket_) { | 345 if (!socket_) { |
340 error_ = SOCKET_ERROR; | 346 error_ = SOCKET_ERROR; |
341 return false; | 347 return false; |
342 } | 348 } |
343 | 349 |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 } else { | 1549 } else { |
1544 state_ = STATE_UNBOUND; | 1550 state_ = STATE_UNBOUND; |
1545 port_->FailAndPruneConnection(ext_addr_); | 1551 port_->FailAndPruneConnection(ext_addr_); |
1546 } | 1552 } |
1547 } | 1553 } |
1548 void TurnEntry::OnChannelBindTimeout() { | 1554 void TurnEntry::OnChannelBindTimeout() { |
1549 state_ = STATE_UNBOUND; | 1555 state_ = STATE_UNBOUND; |
1550 port_->FailAndPruneConnection(ext_addr_); | 1556 port_->FailAndPruneConnection(ext_addr_); |
1551 } | 1557 } |
1552 } // namespace cricket | 1558 } // namespace cricket |
OLD | NEW |