Closed nelsonic closed 2 years ago
Looks like updating Phoenix (and all deps, specifically plug_crypt
) will solve this:
https://elixirforum.com/t/undefinedfunctionerror-function-crypto-hmac-3-is-undefined-or-private/40060
As per: https://github.com/dwyl/learn-phoenix-framework/issues/143#issuecomment-927660108
{:phoenix, "~> 1.6.0"},
{:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.0"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.16.4"},
{:floki, ">= 0.30.0", only: :test},
{:phoenix_live_dashboard, "~> 0.5"},
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},
{:swoosh, "~> 1.3"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.18"},
{:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"}
Update to Phoenix 1.6 going smoothly. All tests pass (as expected).
The app boots fine:
And OAuth link works:
But when I attempt to sign in I get the following error:
[info] GET /auth/github/callback
[debug] Processing with AppWeb.GithubAuthController.index/2
Parameters: %{"code" => "ac0098aaredacted"}
Pipelines: [:browser]
[info] TLS :client: In state :wait_cert_cr at ssl_handshake.erl:1990 generated CLIENT ALERT: Fatal - Handshake Failure
- {:bad_cert, :hostname_check_failed}
[info] Sent 500 in 373ms
[error] #PID<0.718.0> running AppWeb.Endpoint (connection #PID<0.717.0>, stream id 1) terminated
Server: localhost:4000 (http)
Request: GET /auth/github/callback?code=ac0098aaredacted
** (exit) an exception was raised:
** (HTTPoison.Error) {:tls_alert, {:handshake_failure, 'TLS client: In state wait_cert_cr at ssl_handshake.erl:1990 generated CLIENT ALERT: Fatal - Handshake Failure\n {bad_cert,hostname_check_failed}'}}
(httpoison 1.7.0) lib/httpoison.ex:128: HTTPoison.request!/5
(elixir_auth_github 1.4.0) lib/elixir_auth_github.ex:79: ElixirAuthGithub.get_user_details/1
(app 1.4.0) lib/app_web/controllers/github_auth_controller.ex:9: AppWeb.GithubAuthController.index/2
(app 1.4.0) lib/app_web/controllers/github_auth_controller.ex:1: AppWeb.GithubAuthController.action/2
(app 1.4.0) lib/app_web/controllers/github_auth_controller.ex:1: AppWeb.GithubAuthController.phoenix_controller_pipeline/2
(phoenix 1.6.0) lib/phoenix/router.ex:355: Phoenix.Router.__call__/2
(app 1.4.0) lib/app_web/endpoint.ex:1: AppWeb.Endpoint.plug_builder_call/2
(app 1.4.0) lib/plug/debugger.ex:136: AppWeb.Endpoint."call (overridable 3)"/2
(app 1.4.0) lib/app_web/endpoint.ex:1: AppWeb.Endpoint.call/2
(phoenix 1.6.0) lib/phoenix/endpoint/cowboy2_handler.ex:43: Phoenix.Endpoint.Cowboy2Handler.init/4
(cowboy 2.9.0) ~/code/elixir-auth-github-demo/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
(cowboy 2.9.0) ~/code/elixir-auth-github-demo/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
(cowboy 2.9.0) ~/code/elixir-auth-github-demo/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
(stdlib 3.15.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Looks like we might need to update the underlying HTTPoision dependency in the parent package. 💭
Works flawlessly on localhost
with latest Elixir & Phoenix:
PR: #18
The Heroku version of this demo app https://elixir-auth-github-demo.herokuapp.com is still working fine:
It's running on an older version of Elixir/OTP:
https://github.com/dwyl/elixir-auth-github-demo/blob/016e4c478c9e92adcf32b5a316695809b6e50d23/elixir_buildpack.config#L1-L5
Just tried to run the app on my
localhost
using:Getting the following error:
Full debug stack trace:
Need to get back to my "day job" work, so need to come back to this later.
Todo
:crypto.hmac/3
issue ... 🤞