-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please how do we get Tesla to emulate -k/--insecure
of curl ?
#389
Labels
Comments
It depends on the adapter. For hackney: {:error, {:tls_alert, {:bad_certificate, _}}} =
Tesla.client([], Tesla.Adapter.Hackney) |> Tesla.get("https://self-signed.badssl.com/")
{:ok, %Tesla.Env{}} =
Tesla.client([], {Tesla.Adapter.Hackney, insecure: true})
|> Tesla.get("https://self-signed.badssl.com/") |
Ah, I Was using the default adapter:
Solved. @chulkilee Thanks |
@CharlesOkwuagwu if you use Httpc, by default it does not check SSL. {:ok, %Tesla.Env{}} =
Tesla.client([], Tesla.Adapter.Httpc) |> Tesla.get("https://self-signed.badssl.com/")
httpc_client =
Tesla.client(
[],
{Tesla.Adapter.Httpc,
ssl: [cacerts: :certifi.cacerts(), verify_fun: &:ssl_verify_hostname.verify_fun/3]}
)
{:error, :econnrefused} = Tesla.get(httpc_client, "https://self-signed.badssl.com/")
{:ok, %Tesla.Env{}} = Tesla.get(httpc_client, "https://mozilla-modern.badssl.com/") |
Thanks @chulkilee ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please how do we get Tesla to emulate
-k/--insecure
of curl ?Tesla
iex> Tesla.get("https://localhost:44384/get_company_mappings/10")
[error: :econnrefused]
iex>
CURL
CURL -k
The text was updated successfully, but these errors were encountered: