Skip to content

Commit

Permalink
fix: fast fail on invalid ssl options
Browse files Browse the repository at this point in the history
  • Loading branch information
terry-xiaoyu committed Aug 5, 2024
1 parent 7e9e98f commit 724bd4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/esockd.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{application, esockd,
[{description, "General Non-blocking TCP/SSL and UDP/DTLS Server"},
{id, "esockd"},
{vsn, "5.9.7"},
{vsn, git},
{modules, []},
{registered, []},
{applications, [kernel, stdlib, sasl, ssl, public_key]},
Expand Down
6 changes: 5 additions & 1 deletion src/esockd_acceptor_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ ssl_upgrade_fun(Type, Opts) ->
end,
case proplists:get_value(Key, Opts) of
undefined -> [];
SslOpts -> [esockd_transport:ssl_upgrade_fun(SslOpts)]
SslOpts ->
%% validate ssl options and prevent the listener from starting if
%% validation failed
_ = ssl:handle_options(SslOpts, server, undefined),
[esockd_transport:ssl_upgrade_fun(SslOpts)]
end.

tune_socket(Sock, []) ->
Expand Down

0 comments on commit 724bd4c

Please sign in to comment.