title: Native Webrtc how to disable encryption for DataChannel of PeerConnection
body: <p>I am currently working on within a project which is trying to build a communication adapter for the old game Supreme Commander. This communication adapter uses native webrtc. The project is Forged Alliance Forever and this is the repositoy for the communication adapter: github.com/FAForever/ice-adapter</p>
  
  <p>The communication adapter is currently working with encrypted communication, but we would like to disable encryption. Upload Bandwidth is a limiting factor in games with many participants and DTLS adds overhead to each message. Those messages have a little size of around 20-50 bytes. Therefore overhead of the DTLS header and padding are significant.</p>
  
  <p>So here is the question:
  Is it possible to disable encryption for the DataChannel of a PeerConnection using the native webrtc release 68?</p>
  
  <p>If so, how? Do you have a minimal example?</p>
  
  <p>I tried the following things (sorry for code snippets):</p>
  
  <p>Create PeerConnectionFactory and disable encryption in the options:</p>
  
  <pre><code>_pcfactory = webrtc::CreateModularPeerConnectionFactory(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
  webrtc::PeerConnectionFactoryInterface::Options webRtcOptions;
  webRtcOptions.disable_encryption = true;
  _pcfactory-&gt;SetOptions(webRtcOptions);
  </code></pre>
  
  <p>Create the PeerConnection with enable rtp data channel:</p>
  
  <pre><code>webrtc::PeerConnectionInterface::RTCConfiguration configuration;
  configuration.servers = _iceServerList;
  configuration.enable_rtp_data_channel = true;
  _peerConnection = _pcfactory-&gt;CreatePeerConnection(configuration,nullptr, nullptr, _peerConnectionObserverObj);
  </code></pre>
  
  <p>This is so far what I have tested. The problem is now, that the answerer side produces an abort in channel.cc, so maybe i did not use the interface correctly. Do you have any suggestions?</p>
  
  <p>Regards</p>