25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-18 17:24:31 +01:00

Merge remote-tracking branch 'processone/pr/4323'

* processone/pr/4323:
  Enable allow_unencrypted_sasl2 on websockets
This commit is contained in:
Holger Weiss 2024-12-03 18:58:25 +01:00
commit 7fce7d1049
2 changed files with 7 additions and 0 deletions

View File

@ -69,6 +69,7 @@
default_host, default_host,
custom_headers, custom_headers,
trail = <<>>, trail = <<>>,
allow_unencrypted_sasl2,
addr_re, addr_re,
sock_peer_name = none sock_peer_name = none
}). }).
@ -133,10 +134,12 @@ init(SockMod, Socket, Opts) ->
CustomHeaders = proplists:get_value(custom_headers, Opts, []), CustomHeaders = proplists:get_value(custom_headers, Opts, []),
AllowUnencryptedSasl2 = proplists:get_bool(allow_unencrypted_sasl2, Opts),
State = #state{sockmod = SockMod1, State = #state{sockmod = SockMod1,
socket = Socket1, socket = Socket1,
custom_headers = CustomHeaders, custom_headers = CustomHeaders,
options = Opts, options = Opts,
allow_unencrypted_sasl2 = AllowUnencryptedSasl2,
request_handlers = RequestHandlers, request_handlers = RequestHandlers,
sock_peer_name = SockPeer, sock_peer_name = SockPeer,
addr_re = RE}, addr_re = RE},
@ -916,6 +919,8 @@ normalize_path([Part | Path], Norm) ->
listen_opt_type(tag) -> listen_opt_type(tag) ->
econf:binary(); econf:binary();
listen_opt_type(allow_unencrypted_sasl2) ->
econf:bool();
listen_opt_type(request_handlers) -> listen_opt_type(request_handlers) ->
econf:map( econf:map(
econf:and_then( econf:and_then(
@ -941,6 +946,7 @@ listen_options() ->
{protocol_options, undefined}, {protocol_options, undefined},
{tls, false}, {tls, false},
{tls_compression, false}, {tls_compression, false},
{allow_unencrypted_sasl2, false},
{request_handlers, []}, {request_handlers, []},
{tag, <<>>}, {tag, <<>>},
{default_host, undefined}, {default_host, undefined},

View File

@ -122,6 +122,7 @@ init([{#ws{ip = IP, http_opts = HOpts}, _} = WS]) ->
({max_ack_queue, _}) -> true; ({max_ack_queue, _}) -> true;
({ack_timeout, _}) -> true; ({ack_timeout, _}) -> true;
({resume_timeout, _}) -> true; ({resume_timeout, _}) -> true;
({allow_unencrypted_sasl2, _}) -> true;
({max_resume_timeout, _}) -> true; ({max_resume_timeout, _}) -> true;
({resend_on_timeout, _}) -> true; ({resend_on_timeout, _}) -> true;
({access, _}) -> true; ({access, _}) -> true;