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

bakeware messes up ssl library? #100

Closed
vans163 opened this issue Mar 15, 2021 · 8 comments
Closed

bakeware messes up ssl library? #100

vans163 opened this issue Mar 15, 2021 · 8 comments

Comments

@vans163
Copy link
Contributor

vans163 commented Mar 15, 2021

So I am using ssl module to make a connection, and the version compiled with newest bakeware gives a :socket, :closed error for some reason on every launch. While the non-bakeware version works just fine.

Im drum up a more pinpointed test case, but it seems like something went wrong in the latest bake-bake-bake bakeware as my app worked fine before.

@vans163
Copy link
Contributor Author

vans163 commented Mar 15, 2021

warning: Caught exception in Elixir.Prism.Bakeware.main/1: :exit => {{{:bad_action_from_state_function, {{:timeout, :handshake}, :cancel}},
  [
    {:gen_statem, :loop_actions_timeout, 13,
     [file: 'gen_statem.erl', line: 1615]},
    {:tls_connection, :init, 1, [file: 'tls_connection.erl', line: 153]},
    {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}
  ]}, {:gen_statem, :call, [#PID<0.883.0>, {:recv, 0, :infinity}, :infinity]}}
  (stdlib 3.9.2) gen.erl:177: :gen.do_call/4
  (stdlib 3.9.2) gen_statem.erl:611: :gen_statem.call_dirty/4
  (ssl 9.6.1) ssl_connection.erl:2525: :ssl_connection.call/2

I am able to recreate this

        {:ok, socket} = :ssl.connect({11,1,1,1}, 443, [{:server_name_indication, 'name}, {:active, false}, :binary], 30_000)
        :ok = :ssl.send(socket, <<>>)
        IO.puts :ssl.recv(socket, 0)

So on :ssl.recv the error above happens. It seems maybe the :SSL module is not setup correctly. (The ssl module is really complex requiring a bunch of ets and other preinited tables)

@vans163
Copy link
Contributor Author

vans163 commented Mar 15, 2021

Tried even spawning a process inside the main function, same problem, the ssl connection is all messed up.

@vans163
Copy link
Contributor Author

vans163 commented Mar 15, 2021

After further testing I think this is an issue with elixir releases on >=1.11.0

@vans163
Copy link
Contributor Author

vans163 commented Mar 15, 2021

Update on this, solved my problems by statically compiling openssl 1.1.1j into erlang itself. Maybe a note makes sense to have in the README, but not sure if this is an isolated issue with only my env.

@fhunleth
Copy link
Contributor

@vans163 What platform and OTP versions are you using? Could it be an issue similar to this erlef/setup-beam#7?

I also agree that it's worth a note to the README about statically linking OpenSSL. If you could PR some text that briefly describes the issue (one sentence is fine) and points to instructions on how to statically link openssl, that would be really helpful.

@vans163
Copy link
Contributor Author

vans163 commented Mar 15, 2021

That issue looks a little different but who knows. The OTP is 23.2.7 erts 11.1.8 elixir 1.11.3 on ubuntu 20.10. Il make a PR yea NP.

@vans163
Copy link
Contributor Author

vans163 commented Mar 15, 2021

#102

@jjcarstens
Copy link
Contributor

Addressed with #102

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

3 participants