Skip to content

Commit

Permalink
Merge pull request #12 from mrallen1/otp_20
Browse files Browse the repository at this point in the history
Explicitly disable server name indication
  • Loading branch information
nalundgaard authored Sep 25, 2017
2 parents c7ae379 + 4067c7e commit d3d9bf1
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit d3d9bf1

Please sign in to comment.