peburrows / goth

Elixir package for Oauth authentication via Google Cloud APIs
http://hexdocs.pm/goth
MIT License
289 stars 111 forks source link

Unknown CA error in Goth #99

Closed Papillon6814 closed 3 years ago

Papillon6814 commented 3 years ago

Hello. I'm using goth with elixir-google-api.

Goth works in my dev environment, but It does not work in my remote docker container.

** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: {:tls_alert, {:unknown_ca, 'TLS client: In state wait_cert_cr at ssl_handshake.erl:1895 generated CLIENT ALERT: Fatal - Unknown CA\n'}}}}

It occurs when I run this function.

{:ok, token} = Goth.Token.for_scope("https://www.googleapis.com/auth/cloud-platform")

Is there any hints to resolve it?

wojtekmach commented 3 years ago

I remember seeing this error with certain hackney versions, Id try upgrading to the latest. Same goes for your OTP version.

Basically if HTTPoison.get!("https://www.googleapis.com/auth/cloud-platform") fails, it is not a Goth problem per se, if that makes sense.

hope this helps!