edgurgel / httpoison

Yet Another HTTP client for Elixir powered by hackney
https://hex.pm/packages/httpoison
MIT License
2.23k stars 339 forks source link

Specify default options #417

Open SachsKaylee opened 4 years ago

SachsKaylee commented 4 years ago

Hello there,

as of OTP 23 we are running into the issue that SSLv3 is no longer supported, which in itself is great. Howerver it seems that HTTPPoison still attempts to use it, which raises an error.

(HTTPoison.Error) {:options, {:sslv3, {:versions, [:"tlsv1.2", :"tlsv1.1", :tlsv1, :sslv3]}}}
        (httpoison 1.7.0) lib/httpoison.ex:128: HTTPoison.request!/5

This is easy to fix by simply adding [ssl: [versions: :"tlsv1.2"]] as an option when making HTTP requests. However, this become quite the maintenance burden when having to retroactively add this to every since request.

Skimming through the source code of hackney and HTTPPoison I did not see a config value to specify this as a default, but I'm quite sure I missed something as this seems like a common use case.

Thank you for your time

Fudoshiki commented 3 years ago

Dependencies

https://github.com/benoitc/hackney/issues/664 https://github.com/thoughtbot/bamboo/issues/565 https://github.com/peburrows/goth/issues/72