2

Am doing a post with HTTPoison, on one machine everything works well, but in the other the same code, with similar environment parameters.

HTTPoison.post!("https://remote_api", "", [{"X-TOKEN", System.get_env("API_TOKEN"}, {"Content-Type", "application/json"}])

fails with

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

both machines are setup the same running centos7, but i get expected results in one but not in the other. am not sure what i got wrong

Downgrading to OTP 22 fixed it, thanks Aleksei Matiushkin.

Ricoh
  • 39
  • 1
  • 7
  • `:sslv3` is likely the issue. Please check both machines OTP versions and post results here (e. g. by running `erl`.) – Aleksei Matiushkin May 15 '20 at 11:47
  • ``` Erlang/OTP 23 [erts-11.0] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe] Eshell V11.0 (abort with ^G) ``` both return the same result – Ricoh May 15 '20 at 12:39
  • Support for `SSL 3.0` was completely removed from `Erlang 23.0`. https://www.erlang.org/news/140 What Elixir versions are there? Only `1.10.3` fully supports `OTP23`. Test with `iex`. – Aleksei Matiushkin May 15 '20 at 12:50
  • Yikes, now thats some useful info, using elixir `1.9.4` – Ricoh May 15 '20 at 13:02

3 Answers3

1

I'm having the same issue and it looks like this fix in hackney will resolve the problem. It's been merged to master but hasn't been released yet.

In the meantime, downgrading to OTP 22 is a good solution.

balexand
  • 9,549
  • 7
  • 41
  • 36
1

This works for me for the moment:

{:hackney, git: "https://github.com/benoitc/hackney.git", branch: "master", override: true}
0

Bumping hackney to version 1.16 worked for me.

 defp deps do
    [
      ...
      {:httpoison, "~> 1.6"},
      {:hackney, "~> 1.16"}
    ]
  end
mind.blank
  • 4,820
  • 3
  • 22
  • 49