edgurgel / httpoison

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

TLS client: In state wait_cert_cr at ssl_handshake.erl:1984 generated CLIENT ALERT: Fatal - Unknown CA #455

Closed felipeloha closed 2 years ago

felipeloha commented 2 years ago

I have the following error using the following dependencies

  defp deps do
    [
      {:credo, "~> 1.0", only: [:dev, :test], runtime: false},
      {:dialyxir, "~> 1.1", only: :dev, runtime: false},
      {:excoveralls, "~> 0.11", only: :test},
      {:git_hooks, "~> 0.6.4", only: [:dev], runtime: false},
      {:httpoison, "~> 1.6"},
      {:jason, "~> 1.1"},
      {:plug, "~> 1.12.1"},
      {:poison, "~> 3.1.0"}
    ]
  end

error:

assert {:ok, _} =
             HTTPoison.post(
               "https://customer.com/internal/api/internal_entity",
               Poison.encode!(%{"request" => %{"attr" => "value"}}),
               # pool: :custom_pool,
               # hackney: [:insecure],
               ssl: [
                 versions: [:"tlsv1.2"],
                 #cacertfile: :certifi.cacertfile() |> IO.inspect()
               ]
             )

I tried using all possible combinations in the options and is still not working I also tried mix deps.update certifi and setting a path to one of my own certififcates

Any idea what this could be?

felipeloha commented 2 years ago

obsolete

entropidelic commented 2 years ago

I am having this same issue, how did you solve it?

felipeloha commented 2 years ago

I was using a random url without mocking it. After I mocked it, it worked