diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index e96ed0dc8e0a..0bd2b1bd80aa 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -3552,15 +3552,17 @@ sign_type(ecdsa) -> server_name(_, _, server) -> undefined; %% Not interesting to check your own name. server_name(SSLOpts, Host, client) -> - SNI = case maps:get(server_name_indication, SSLOpts, undefined) of - undefined -> Host; %% Fallback to Host argument to connect - UserSNI -> UserSNI %% If Server Name Indication is available - end, - case is_atom(SNI) of - true -> atom_to_list(SNI); - false -> SNI + case maps:get(server_name_indication, SSLOpts, undefined) of + disable -> disable; + undefined -> convert_hostname(Host); %% Fallback to Host argument to connect + UserSNI -> convert_hostname(UserSNI) %% If Server Name Indication is available end. +convert_hostname(SNI) when is_atom(SNI) -> + atom_to_list(SNI); +convert_hostname(SNI) -> + SNI. + client_ecc_extensions(SupportedECCs) -> CryptoSupport = proplists:get_value(public_keys, crypto:supports()), case proplists:get_bool(ecdh, CryptoSupport) of