@@ -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
2121maybe_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) ->
3738maybe_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.
4241maybe_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