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

Unified Diff: webrtc/api/peerconnection.cc

Issue 2557803002: Add disabled certificate check support to IceServer PeerConnection API. (Closed)
Patch Set: Add disabled certificate check support to IceServer PeerConnection API. Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/api/peerconnection_unittest.cc » ('j') | webrtc/api/peerconnectioninterface.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnection.cc
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc
index 46bdec594a9c90fcd1630db748921237807902d2..c2f29d1fba1dd98db49b636532cac94ca4e26b11 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -284,7 +284,7 @@ bool ParseIceServerUrl(const PeerConnectionInterface::IceServer& server,
int port = kDefaultStunPort;
if (service_type == TURNS) {
port = kDefaultStunTlsPort;
- turn_transport_type = cricket::PROTO_TCP;
+ turn_transport_type = cricket::PROTO_TLS;
}
std::string address;
@@ -305,10 +305,15 @@ bool ParseIceServerUrl(const PeerConnectionInterface::IceServer& server,
break;
case TURN:
case TURNS: {
- bool secure = (service_type == TURNS);
+ cricket::ProtocolFlags flags = cricket::PROTO_FLAG_NONE;
+ if (server.tls_certificate_policy ==
+ PeerConnectionInterface::kTlsCertPolicyInsecureNoCheck) {
+ flags = (cricket::ProtocolFlags)(
+ flags | cricket::PROTO_FLAG_INSECURE_CERT_CHECK);
+ }
turn_servers->push_back(
cricket::RelayServerConfig(address, port, username, server.password,
- turn_transport_type, secure));
+ turn_transport_type, flags));
pthatcher1 2016/12/07 21:29:35 Attaching flags onto relay servers feels like the
Taylor Brandstetter 2016/12/08 01:36:40 I disagree. "Verify certificate or not?" is fundam
pthatcher1 2016/12/08 02:36:13 Perhaps I misunderstood the use case we're trying
Taylor Brandstetter 2016/12/08 18:51:39 Maybe there's no obvious use case right now. But:
hnsl1 2016/12/12 16:08:13 Imagine a scenario where you have a RTCConfigurati
pthatcher1 2016/12/12 23:12:29 OK, I think I understand the use case. Let's talk
break;
}
case INVALID:
« no previous file with comments | « no previous file | webrtc/api/peerconnection_unittest.cc » ('j') | webrtc/api/peerconnectioninterface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698