From d7dbc57b12140926da274c1b0d2e5af763e1cf06 Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Tue, 6 Oct 2020 18:25:49 +0200 Subject: [PATCH] Prevent protocol encryption over WebRTC --- src/bt_peer_connection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index 886dc39f250..634d15b3a71 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -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]));