Skip to content

Commit a686610

Browse files
committed
fix: use sni host for default ssl verification
1 parent e2bbdf7 commit a686610

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hackney_connection.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ ssl_opts_2() ->
135135
hackney_ssl:cipher_opts().
136136

137137
merge_ssl_opts(Host, OverrideOpts) ->
138-
DefaultOpts = ssl_opts_1(Host, OverrideOpts),
138+
VerifyHost = case proplists:get_value(server_name_indication, OverrideOpts, disable) of
139+
disable -> Host;
140+
SNI -> SNI
141+
end,
142+
DefaultOpts = ssl_opts_1(VerifyHost, OverrideOpts),
139143
MergedOpts = orddict:merge(fun(_K, _V1, V) -> V end,
140144
orddict:from_list(DefaultOpts),
141145
orddict:from_list(OverrideOpts)),

0 commit comments

Comments
 (0)