tigase / beagle-im

(M) XMPP client for macOS based on TigaseSwift XMPP library
GNU General Public License v3.0
181 stars 21 forks source link

Crash when audio call connects using Little Snitch to force TURN #108

Open rbreslow opened 2 years ago

rbreslow commented 2 years ago

Describe the bug

Using Little Snitch, I have a rule in place that allows all connections to my personal XMPP/TURN server and denies everything else:

image

I'd like all of my calls to go through my XMPP server so folks don't have my client's IP address.

Changing the deny rule to Ask for any outgoing connections prompts me to allow an outgoing connection to a single IP (presumably my contact's voice server, or something) when the call connects. If I leave this prompt hanging, the call immediately connects via my personal TURN server.

However, if I deny the prompt from Little Snitch and try to call back, BeagleIM will crash as soon as the call connects:

![image](https://user-images.githubusercontent.com/1774125/179358668-66d538f2-fc26-4f66-97aa-70d74b47913a.png)

To Reproduce

  1. Configure Little Snitch as I have above.
  2. Try to make a call.
  3. BeagleIM will crash once the call connects.

Expected behavior

  1. BeagleIM doesn't crash when I try to make a call.

Desktop (please complete the following information):

I can reproduce this bug on Beagle 5.1, Beagle 5.2, and Beagle 5.3-b157 on macOS 11.6.7 (20G630) using Little Snitch 5.4.1 (6256).

hantu85 commented 2 years ago

AFAIK even if you block all outgoing & incoming traffic except to your XMPP server (which in your case would also need to be a TURN server), then WebRTC (used to establish the connection) will try to get your client's external IP from your TURN server (using STUN) and when found would XMPP client will send it to other call participants as the endpoint which should be checked/used for establishing WebRTC connection?

Unless you modify your TURN server not to send back to you your client's IP address (I'm not sure if that is possible).

Anyway, we will review crash logs and provide a fix crash is inside BeagleIM (and not in WebRTC).