Skip to content

Commit d4ce443

Browse files
amqp_ssl: simplify
Now that Erlang 26 is the minimum required version.
1 parent 7d8a281 commit d4ce443

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

deps/amqp_client/src/amqp_client.erl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
%%---------------------------------------------------------------------------
1919

2020
start() ->
21-
%% rabbit_common needs compiler and syntax_tools, see
22-
%%
23-
%% * https://github.com/rabbitmq/rabbitmq-erlang-client/issues/72
24-
%% * https://github.com/rabbitmq/rabbitmq-common/pull/149
2521
{ok, _} = application:ensure_all_started(rabbit_common),
2622
{ok, _} = application:ensure_all_started(amqp_client),
2723
ok.

deps/amqp_client/src/amqp_ssl.erl

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ maybe_enhance_ssl_options(Params) ->
1919

2020
% https://github.com/erlang/otp/blob/master/lib/inets/src/http_client/httpc_handler.erl
2121
maybe_add_sni(Host, Options) ->
22-
maybe_add_sni_0(lists:keyfind(server_name_indication, 1, Options), Host, Options).
22+
ServerNameIndicationKeyFound = lists:keyfind(server_name_indication, 1, Options),
23+
maybe_add_sni_0(ServerNameIndicationKeyFound, Host, Options).
2324

24-
maybe_add_sni_0(false, Host, Options) ->
25+
maybe_add_sni_0(false = _ServerNameIndicationKeyFound, Host, Options) ->
2526
% NB: this is the case where the user did not specify
2627
% server_name_indication at all. If Host is a DNS host name,
2728
% we will specify server_name_indication via code
@@ -37,23 +38,14 @@ maybe_add_sni_1(false, _Host, Options) ->
3738
maybe_add_sni_1(true, Host, Options) ->
3839
[{server_name_indication, Host} | Options].
3940

40-
%% This check is no longer necessary starting with OTP-26.
41-
%% @todo Remove the check once we support only OTP-26 and above.
4241
maybe_add_verify(Options) ->
43-
%% This function is only defined starting in OTP-26.
44-
case erlang:function_exported(user_drv, whereis_group, 0) of
45-
true -> Options;
46-
false -> maybe_add_verify1(Options)
47-
end.
48-
49-
maybe_add_verify1(Options) ->
5042
case lists:keymember(verify, 1, Options) of
5143
true ->
5244
% NB: user has explicitly set 'verify'
5345
Options;
5446
_ ->
5547
?LOG_WARNING("Connection (~tp): certificate chain verification is not enabled for this TLS connection. "
56-
"Please see https://rabbitmq.com/ssl.html for more information.", [self()]),
48+
"Please see https://rabbitmq.com/ssl.html for more information.", [self()]),
5749
Options
5850
end.
5951

0 commit comments

Comments
 (0)