benoitc / hackney

simple HTTP client in Erlang
Other
1.34k stars 427 forks source link

Failed to send https request on OTP 22.1 #591

Closed yjh0502 closed 5 years ago

yjh0502 commented 5 years ago

Hackney returns {error,{option,server_only,honor_cipher_order}} with https url, starting from OTP 22.1.

Here's a location on ssl library which causes a problem. It seems that honor_cipher_order have not been work on client connections so they started blocking it. https://github.com/erlang/otp/blob/bf2dfb7f51fa50d832f4dc4e4e271e7a6df93629/lib/ssl/src/ssl.erl#L1703-L1706

Commenting following line fixes the problem. https://github.com/benoitc/hackney/blob/master/src/hackney_ssl.erl#L68

gmile commented 5 years ago

FWIW I just noticed a similar line with honor_cipher_order was removed from hex back in January https://github.com/hexpm/hex/commit/f34518e143a59118589d65494ab4dc5181e782db

ruudk commented 5 years ago

Is there a workaround to this issue?

lasseebert commented 5 years ago

@ruudk, I think only workarounds are downgrade erlang or fork hackney.

benoitc commented 5 years ago

or wait i merge the pr tonight.

benoitc commented 5 years ago

fixed in latest master

hernanat commented 5 years ago

@benoitc are you planning a release for this as well? Not too familiar with your project or release strategy, sorry if it's a silly question.

benoitc commented 5 years ago

@hernanat i will make a release today. Was too late yesterday for it :)

ggwc82 commented 5 years ago

Hi, can you please increment the Hackney version so that we can pull in changes from Hex for this? Thanks

mdarby commented 5 years ago

Can we get a new version cut? This is a big blocker. I appreciate it!

ltj commented 5 years ago

While waiting for a new hex release, you can point deps to the github master branch or downgrade to OTP 22.0.7. Both are perfectly viable options ;)

timbuckley commented 5 years ago

If anyone is having problems down the chain on Elixir and finds yourself here, here's a quick fix for now: https://github.com/edgurgel/httpoison/issues/393

To fix: Put this in your mix.exs

{:hackney, github: "benoitc/hackney", override: true}
benoitc commented 5 years ago

@mdarby just released the version 1.15.2 . Was side-tracked. Hope it helps :)

ruudk commented 5 years ago

Because nobody replied yet: Tested it and verified that it works. Thanks @benoitc ❤️

chrisapa commented 5 years ago

If anyone is having problems down the chain on Elixir and finds yourself here, here's a quick fix for now: edgurgel/httpoison#393

To fix: Put this in your mix.exs

{:hackney, github: "benoitc/hackney", override: true}

Worked for me, but first I had to update hex to the last version.

sebbean commented 4 years ago

thanks boize @lxqnt appreciates

mucho calor!