Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly disable server name indication #12

Merged
merged 1 commit into from
Sep 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/lhttpc_sock.erl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@
-spec connect(host(), integer(), socket_options(), timeout(), boolean()) ->
{ok, socket()} | {error, atom()}.
connect(Host, Port, Options, Timeout, true) ->
ssl:connect(Host, Port, Options, Timeout);
%% Server Name Indication is this:
%% https://en.wikipedia.org/wiki/Server_Name_Indication
%%
%% We inject this option here because as of OTP 20, the server name is
%% passed back as a return value so it can be validated by the client.
%% We want the previous behavior which ignored the server name
%% indicator, so disable this. I believe this option has existed
%% since R16.
ssl:connect(Host, Port, [ {server_name_indication, disable} | Options ], Timeout);
connect(Host, Port, Options, Timeout, false) ->
gen_tcp:connect(Host, Port, Options, Timeout).

Expand Down