Skip to content

Commit 9c3f578

Browse files
jonnystormbenoitc
authored andcommitted
Fix error caused by honor_cipher_order, CI errors (#589)
OTP-22.1 (124da8950c) introduced `assert_role/4` into `:ssl`, which throws an error when `:ssl.connect` is called with the `honor_cipher_order` option defined. The error returned is `{:error, {:option, :server_only, :honor_cipher_order}}`. With OTP-22.1, a dialyzer warning also appears. 129: Invalid type specification for function hackney_ssl:shutdown/2. The success typing is ( { 'sslsocket', _, nonempty_maybe_improper_list() | {'dtls' | port(), _} }, 'read' | 'read_write' | 'write' ) -> 'ok' | {'error',_} Prior to the above, CI errors began to appear as a result of cowboy-1.0.4 download failures. Using cowboy-1.1.2 fixes this. * remove `honor_cipher_order` option in `connect/4` * add OTP-22.0 to .travis.yml * drop OTP-20.2 from .travis.yml (no longer available) * fix invalid type spec for `shutdown/2` * require cowboy-1.1.2
1 parent b3ea4ea commit 9c3f578

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: erlang
22
otp_release:
3+
- 22.0
34
- 21.0.2
45
- 20.3
5-
- 20.2
66
- 19.3
77

88
env:

rebar.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{top_level_readme,
3636
{"./README.md", "http://github.com/benoitc/hackney"}}]}]},
3737
{test, [
38-
{deps, [{cowboy, "1.0.4"}, {jsone, "1.4.7"}]}
38+
{deps, [{cowboy, "1.1.2"}, {jsone, "1.4.7"}]}
3939
]}
4040
]}.
4141

rebar.config.script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Rebar2Deps0 = [{idna, ".*",
2323

2424
Rebar2Deps = case os:getenv("TEST") of
2525
"1" -> [{cowboy, ".*", {git, "https://github.com/ninenines/cowboy.git",
26-
{tag, "1.0.4"}}},
26+
{tag, "1.1.2"}}},
2727
{jsone, ".*", {git, "https://github.com/sile/jsone.git",
2828
{tag, "1.4.7"}}} | Rebar2Deps0];
2929
false ->

src/hackney_ssl.erl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ connect(Host, Port, Opts, Timeout) when is_list(Host), is_integer(Port),
6565
BaseOpts = [binary, {active, false}, {packet, raw},
6666
{secure_renegotiate, true},
6767
{reuse_sessions, true},
68-
{honor_cipher_order, true},
6968
{versions,['tlsv1.2', 'tlsv1.1', tlsv1, sslv3]},
7069
{ciphers, ciphers()}],
7170
Opts1 = hackney_util:merge_opts(BaseOpts, Opts),
@@ -126,7 +125,7 @@ close(Socket) ->
126125

127126
%% @doc Immediately close a socket in one or two directions.
128127
%% @see ssl:shutdown/2
129-
-spec shutdown(ssl:socket(), read | write | read_write) -> ok.
128+
-spec shutdown(ssl:sslsocket(), read | write | read_write) -> ok | {error, any()}.
130129
shutdown(Socket, How) ->
131130
ssl:shutdown(Socket, How).
132131

0 commit comments

Comments
 (0)