Skip to content

Commit

Permalink
Merge pull request #13 from erlcloud/revert-12-otp_20
Browse files Browse the repository at this point in the history
Revert "Explicitly disable server name indication"
  • Loading branch information
nalundgaard authored Oct 18, 2018
2 parents 5256584 + 787591d commit 41da765
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
41 changes: 30 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
# NOTICE

**This project is not supported anymore.**

It's still here just to support legacy projects that may have it as a dependency.
It's operational (at least, for Erlang versions lower than R17)
If you're looking for a HTTP client, we would recommend you to switch to [shotgun](https://github.com/inaka/shotgun) or [fusco](https://github.com/esl/fusco)
It's operational (at least, for Erlang versions lower than OTP 21)

If you're looking for an HTTP client, we would recommend you to switch to
[shotgun](https://github.com/inaka/shotgun) or [fusco](https://github.com/esl/fusco)

## OTP 20.1 Warning

Dependencies:
* Erlang/OTP R13-B or newer
lhttpc has an issue with OTP 20.1 and a bug in the `server_name_indication` ssl option. See
[#12](https://github.com/erlcloud/lhttpc/pull/12) and [#13](https://github.com/erlcloud/lhttpc/pull/13)
for more details. For lhttpc users on OTP 20.x, it is recommended to upgrade to OTP 20.3 or greater
to avoid this potential issue.

## Dependencies:

* Erlang/OTP R16B03-1 or newer
* Application compiler to build, kernel, stdlib and ssl to run

Building:
For versions > 1.2.5, lhttpc is built using rebar. Take a look at http://bitbucket.org/basho/rebar/wiki/Home for more information. There is still a Makefile with some of the old make targets, such as all, doc, test etc. for those who prefer that. The makefile will however just call rebar.
## Building:

For versions > 1.2.5, lhttpc is built using rebar. Take a look at
http://bitbucket.org/basho/rebar/wiki/Home for more information. There is still
a Makefile with some of the old make targets, such as all, doc, test etc. for those who prefer
that. The makefile will however just call rebar.

## Configuration: (environment variables)

Configuration: (environment variables)
* connection_timeout: The time (in milliseconds) the client will try to
kepp a HTTP/1.1 connection open. Changing this value
in runtime has no effect, this can however be done
through lhttpc_manager:update_connection_timeout/1.
* `connection_timeout`: The time (in milliseconds) the client will try to keep a HTTP/1.1
connection open. Changing this value in runtime has no effect, this can however be done through
`lhttpc_manager:update_connection_timeout/1`.
* `pool_size`: The default number of client processes to allow in an `lhttpc_manager` pool.
Can be overridden at pool creation time, or updated at run-time using
`lhttpc_manager:set_max_pool_size/2`.
10 changes: 1 addition & 9 deletions src/lhttpc_sock.erl
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,7 @@
-spec connect(host(), integer(), socket_options(), timeout(), boolean()) ->
{ok, socket()} | {error, atom()}.
connect(Host, Port, Options, Timeout, true) ->
%% 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);
ssl:connect(Host, Port, Options, Timeout);
connect(Host, Port, Options, Timeout, false) ->
gen_tcp:connect(Host, Port, Options, Timeout).

Expand Down

0 comments on commit 41da765

Please sign in to comment.