Skip to content
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

Example fails to download #7

Open
fireproofsocks opened this issue Jan 27, 2023 · 1 comment
Open

Example fails to download #7

fireproofsocks opened this issue Jan 27, 2023 · 1 comment

Comments

@fireproofsocks
Copy link

I have tried following the examples, e.g.

iex> url = "https://foo.com/large_file.gz"

iex> HTTPStream.get(url)
|> Stream.into(File.stream!("large_file.gz"))
|> Stream.run()

Expected result: the file downloads into the specified target file.

Actual result: Mint adapter:

** (UndefinedFunctionError) function :ssl.cipher_suites/0 is undefined or private, use cipher_suites/2,3 instead
    (ssl 10.5.3) :ssl.cipher_suites()
    (mint 1.1.0) lib/mint/core/transport/ssl.ex:579: Mint.Core.Transport.SSL.default_ciphers/0
    (mint 1.1.0) lib/mint/core/transport/ssl.ex:495: Mint.Core.Transport.SSL.default_ssl_opts/1
    (mint 1.1.0) lib/mint/core/transport/ssl.ex:405: Mint.Core.Transport.SSL.ssl_opts/2
    (mint 1.1.0) lib/mint/core/transport/ssl.ex:318: Mint.Core.Transport.SSL.connect/3
    (mint 1.1.0) lib/mint/negotiate.ex:65: Mint.Negotiate.connect_negotiate/4
    (http_stream 1.0.0) lib/http_stream/adapter/mint.ex:13: HTTPStream.Adapter.Mint.request/1
    (elixir 1.13.0) lib/stream.ex:1517: anonymous fn/5 in Stream.resource/3

Actual result, HTTPoison adapter:

** (ArgumentError) errors were found at the given arguments:

  * 1st argument: the table identifier does not refer to an existing ETS table

    (stdlib 3.16.1) :ets.lookup_element(:hackney_config, :mod_metrics, 2)
    (hackney 1.16.0) /Users/everett/prepos/http_stream/deps/hackney/src/hackney_metrics.erl:27: :hackney_metrics.get_engine/0
    (hackney 1.16.0) /Users/everett/prepos/http_stream/deps/hackney/src/hackney_connect.erl:75: :hackney_connect.create_connection/5
    (hackney 1.16.0) /Users/everett/prepos/http_stream/deps/hackney/src/hackney_connect.erl:44: :hackney_connect.connect/5
    (hackney 1.16.0) /Users/everett/prepos/http_stream/deps/hackney/src/hackney.erl:333: :hackney.request/5
    (httpoison 1.7.0) lib/httpoison/base.ex:796: HTTPoison.Base.request/6
    (elixir 1.13.0) lib/stream.ex:1517: anonymous fn/5 in Stream.resource/3
    (elixir 1.13.0) lib/stream.ex:544: Stream.do_into/4

Other info:

Elixir 1.13.0 (compiled with Erlang/OTP 24)

FYI: hackney is locked at version 1.16.0.

@cigzigwon
Copy link

Have you tried switching to the HTTPoison 1.7 as to use w/adapter? Seems that Mint is a bit more strict with SSL opts but I have not worked w/that here. I have different issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants