Skip to content

Commit

Permalink
Prevent protocol encryption over WebRTC
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau authored and arvidn committed Oct 8, 2020
1 parent 22e98aa commit d7dbc57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bt_peer_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ namespace {
if (is_ssl(get_socket()))
out_policy = settings_pack::pe_disabled;
#endif
#if TORRENT_USE_RTC
// never try an encrypted connection over WebRTC (which is already encrypted)
if (torrent_peer *pi = peer_info_struct())
if (pi->is_rtc_addr)
out_policy = settings_pack::pe_disabled;
#endif
#ifndef TORRENT_DISABLE_LOGGING
static char const* policy_name[] = {"forced", "enabled", "disabled"};
TORRENT_ASSERT(out_policy < sizeof(policy_name)/sizeof(policy_name[0]));
Expand Down

0 comments on commit d7dbc57

Please sign in to comment.