-
Notifications
You must be signed in to change notification settings - Fork 112
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
Default to using Erlang certificates store #435
Conversation
The OTP team no longer supports Erlang versions earlier than 25+, so we can assuming that `:public_key.cacerts_get/0` is available and only fallback to `CAStore` if not. This also solves a bug in that Req/Finch/Mint do not work inside escripts by default (because inside an escript you cannot access the priv dir of an application).
It would be fantastic to get a new minor version with this change to address this: livebook-dev/livebook#2642 But we can also depend on main if merged. :) |
Pull Request Test Coverage Report for Build 31c9a714a5baa02dcdec2221fc6004efd62571d6-PR-435Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build eeb0c17dfbb5c461ce3bb6ae4669a1823da84362-PR-435Details
💛 - Coveralls |
Keyword.put(opts, :cacertfile, CAStore.file_path()) | ||
try do | ||
Keyword.put(opts, :cacerts, :public_key.cacerts_get()) | ||
rescue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we catch UndefinedFunctionError
specifically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it is for when running OTP 25 but OS happens not to have certs, cacerts_get() raises then.
@josevalim 1.6.1 is out 🙃 |
@whatyouhide v1.6.1 is out on GitHub but looks like not yet on Hex! |
Thanks! I'm updating Finch accordingly: sneako/finch#274. |
The OTP team no longer supports Erlang versions earlier than 25+, so we can assuming that
:public_key.cacerts_get/0
is available and only fallback toCAStore
if not.This also solves a bug in that Req/Finch/Mint do not work inside escripts by default (because inside an escript you cannot access the priv dir of an application).