httpelixirphoenix-frameworkhttpoison

HTTPoison request failes on specific machine but works in another machine


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.


Solution

  • Bumping hackney to version 1.16 worked for me.

     defp deps do
        [
          ...
          {:httpoison, "~> 1.6"},
          {:hackney, "~> 1.16"}
        ]
      end