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

Issue with easy_ssl.ex #116

Open
Cyb0rg42 opened this issue Feb 11, 2024 · 7 comments
Open

Issue with easy_ssl.ex #116

Cyb0rg42 opened this issue Feb 11, 2024 · 7 comments

Comments

@Cyb0rg42
Copy link

Cyb0rg42 commented Feb 11, 2024

I trying to run certstream-server and got the following error:

root@vrfcanalyzer:/usr/src/certstream-server# mix run --no-halt
warning: use Mix.Config is deprecated. Use the Config module instead
config/config.exs:1

warning: Mix.Config.config/2 is deprecated. Use the Config module instead
config/config.exs:3

warning: Mix.Config.config/2 is deprecated. Use the Config module instead
config/config.exs:8

warning: Mix.Config.config/2 is deprecated. Use the Config module instead
config/config.exs:12

warning: Mix.Config.config/2 is deprecated. Use the Config module instead
config/config.exs:19

==> easy_ssl
Compiling 1 file (.ex)

== Compilation error in file lib/easy_ssl.ex ==
** (ArgumentError) lib file public_key/include/OTP-PUB-KEY.hrl could not be found
(elixir 1.15.7) lib/record/extractor.ex:41: Record.Extractor.from_lib_file/1
(elixir 1.15.7) lib/record/extractor.ex:18: Record.Extractor.from_or_from_lib_file/1
(elixir 1.15.7) lib/record/extractor.ex:9: Record.Extractor.extract_all/1
lib/easy_ssl.ex:10: (module)
could not compile dependency :easy_ssl, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile easy_ssl --force", update it with "mix deps.update easy_ssl" or clean it with "mix deps.clean easy_ssl"

Running Ubuntu Server 20.04.6 LTS (Focal Fossa) fully patched.
mix deps.compile easy_ssl --force doesn't fix the error. Same error message as above
Any idea what is wrong?

@remil1000
Copy link

you may need to install erlang-dev - apt-get install erlang-dev

dpkg -L erlang-dev | grep OTP
/usr/lib/erlang/lib/public_key-1.7.1/include/OTP-PUB-KEY.hrl

@Cyb0rg42
Copy link
Author

apt-get install erlang-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
erlang-dev is already the newest version (1:26.2.2-1rmq1ppa1~ubuntu20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

dpkg -L erlang-dev | grep OTP
/usr/lib/erlang/lib/public_key-1.15/include/OTP-PUB-KEY.hrl

Already didn't fix the issue.

@remil1000
Copy link

remil1000 commented Feb 12, 2024

Could you give it a try with the Ubuntu managed packages ? it seems you're installing from a rabbitmq PPA
So it may be an erlang version mixup or the rabbitmq ppa packages this differently

update: I can reproduce with add-apt-repository ppa:rabbitmq/rabbitmq-erlang in a ubuntu:20.04 docker container - using Ubuntu packaged elixir and erlang-dev everything compiles fine. Probably the Ubuntu packaged elixir (1.15.7) can't run against erlang 26 provided by the rabbitmq PPA

You may need to run this in docker or use something like asdf to manage multiple versions of erlang (I have zero experience with asdf)

@Cyb0rg42
Copy link
Author

Thanks. Removed all erlang packages from rabbitmq and installed erlang from the Ubuntu repo
BTW:
I followed the instructions on https://elixir-lang.org/install.html
A link to this page can be found at: https://github.com/CaliDog/certstream-server?tab=readme-ov-file -> "instructions for your platform"

Debian (and Ubuntu) alternative

Use the [RabbitMQ Packages](https://launchpad.net/~rabbitmq) (might not be up-to-date however likely newer than the distribution)

$ sudo add-apt-repository ppa:rabbitmq/rabbitmq-erlang
$ sudo apt update
$ sudo apt install elixir erlang-dev erlang-xmerl

@remil1000
Copy link

remil1000 commented Feb 13, 2024

ws:// vs wss:// like http:// vs https://

you probably have no SSL/TLS configured on this localhost:4000 websocket endpoint, try the same using ws://localhost:4000

update: answering a deleted question by OP

@bertdg
Copy link

bertdg commented May 21, 2024

This pull request fixes the issue:
CaliDog/EasySSL#17

You can test by manually editing deps/easy_ssl/mix.exs and adding :public_key to extra_applications.

extra_applications: [:logger, :public_key]

@edwardwc
Copy link

edwardwc commented Jul 16, 2024

For all future MacOS users (and maybe users from other platforms) - the issue probably stems with using the latest Elixir. Going into mix.exs and changing the EasySSL dependency to: {:easy_ssl, github: "CaliDog/EasySSL", branch: "master"} worked!

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

4 participants