Skip to content

Commit

Permalink
Don't attempt authentication if TURN is disabled
Browse files Browse the repository at this point in the history
Explicitly disable authentication if TURN is disabled, as STUN is always
offered without authentication.  This avoids a failure if clients try to
authenticate while TURN is disabled (due to 'auth_fun' being undefined
in that case).
  • Loading branch information
weiss committed Dec 11, 2020
1 parent 36ba97d commit 6feb026
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stun.erl
Expand Up @@ -584,7 +584,8 @@ prepare_state(Opts, Sock, Peer, SockMod) when is_list(Opts) ->
Opts);
_ ->
#state{session_id = ID, sock = Sock, sock_mod = SockMod,
peer = Peer, hook_fun = proplists:get_value(hook_fun, Opts)}
peer = Peer, hook_fun = proplists:get_value(hook_fun, Opts),
auth = anonymous}
end;
prepare_state(State, _Sock, Peer, SockMod) ->
ID = stun_logger:make_id(),
Expand Down

0 comments on commit 6feb026

Please sign in to comment.