fix(gw): update DTLS listener setup according to esockd 5.11.x

Also drop unnecessary UDP default options.
This commit is contained in:
Andrew Mayorov 2023-12-20 12:09:31 +01:00
parent 62bb9938e7
commit 32a64cf201
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 5 additions and 8 deletions

View File

@ -528,7 +528,8 @@ esockd_opts(Type, Opts0) when ?IS_ESOCKD_LISTENER(Type) ->
UDPOpts = sock_opts(udp_options, Opts0), UDPOpts = sock_opts(udp_options, Opts0),
DTLSOpts = ssl_opts(dtls_options, Opts0), DTLSOpts = ssl_opts(dtls_options, Opts0),
Opts2#{ Opts2#{
dtls_options => UDPOpts ++ DTLSOpts udp_options => UDPOpts,
dtls_options => DTLSOpts
} }
end end
). ).
@ -565,13 +566,9 @@ ssl_opts_crl_config(SSLOpts, _Name) ->
%% NOTE: Removing this because DTLS doesn't like any unknown options. %% NOTE: Removing this because DTLS doesn't like any unknown options.
maps:remove(enable_crl_check, SSLOpts). maps:remove(enable_crl_check, SSLOpts).
ssl_opts_drop_unsupported(SSLOpts, ssl_options) -> ssl_opts_drop_unsupported(SSLOpts, _Name) ->
%% TODO: Support OCSP stapling %% TODO: Support OCSP stapling
maps:without([ocsp], SSLOpts); maps:without([ocsp], SSLOpts).
ssl_opts_drop_unsupported(SSLOpts, dtls_options) ->
%% TODO: Support OCSP stapling
%% NOTE: Removing those because DTLS doesn't like any unknown options.
maps:without([ocsp, gc_after_handshake], SSLOpts).
ssl_server_opts(SSLOpts, ssl_options) -> ssl_server_opts(SSLOpts, ssl_options) ->
emqx_tls_lib:to_server_opts(tls, SSLOpts); emqx_tls_lib:to_server_opts(tls, SSLOpts);
@ -665,7 +662,7 @@ default_tcp_options() ->
]. ].
default_udp_options() -> default_udp_options() ->
[binary]. [].
default_subopts() -> default_subopts() ->
%% Retain Handling %% Retain Handling