Closed jagoanmamah closed 4 years ago
Can you copy-paste the full error?
It seems like there's an issue with the SSL handshake. Do you have certify
and ssl_verify_fun
in your deps as outlined in the readme?
defp deps do
[
# ...
{:pow_assent, "~> 0.4.7"},
{:certifi, "~> 2.4"},
{:ssl_verify_fun, "~> 1.1"}
]
end
defp deps do
[
{:phoenix, "~> 1.5", override: true},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_ecto, "~> 4.0"},
{:ecto_sql, "~> 3.1"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2.1", only: :dev},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.1"},
{:pow, "~> 1.0.20"},
{:swoosh, "~> 0.25"},
{:phoenix_swoosh, "~> 0.2"},
{:gen_smtp, "~> 0.13"},
{:pow_assent, "~> 0.4.7"},
{:certifi, "~> 2.4"},
{:ssl_verify_fun, "~> 1.1"},
{:scrivener_ecto, "~> 2.0"},
{:scrivener_html, "~> 1.8.1"},
{:timex, "~> 3.5"}
]
end
Failed with the following error: {:failed_connect, [{:to_address, {'www.googleapis.com', 443}}, {:inet, [:inet], {:tls_alert, {:handshake_failure, 'TLS client: In state wait_cert_cr at ssl_handshake.erl:1840 generated CLIENT ALERT: Fatal - Handshake Failure\n {bad_cert,hostname_check_failed}'}}}]}
Hmm, this could be due to many things.
I tested this locally and it works as expected. You can try it yourself running iex -S mix
in your app dir and then call the following method:
Assent.Strategy.request(:post, "https://www.googleapis.com/oauth2/v4/token", "", [], [http_adapter: Assent.HTTPAdapter.Httpc])
It should return a Assent.HTTPAdapter.HTTPResponse
struct, rather than Assent.RequestError
with the handshake error.
Two questions:
:http_adapter
config set? If :ssl
key is set it would override the default ssl settings.I don't have :http_adapter
Ok, I can reproduce it now. I was running on OTP 22.2. On OTP 23 it fails. Let me figure out why.
Assent v0.1.11
has been released. Run mix deps.update assent
and it should be working again with OTP 23 😄