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

Default to using Erlang certificates store #435

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

josevalim
Copy link
Contributor

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).

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).
@josevalim
Copy link
Contributor Author

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. :)

@coveralls
Copy link

coveralls commented Jun 8, 2024

Pull Request Test Coverage Report for Build 31c9a714a5baa02dcdec2221fc6004efd62571d6-PR-435

Details

  • 2 of 4 (50.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 87.577%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/mint/core/transport/ssl.ex 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
lib/mint/core/transport/ssl.ex 1 85.82%
Totals Coverage Status
Change from base Build f83b897ec3808cd871fa83140ac9d8aa5169b4c6: -0.2%
Covered Lines: 1276
Relevant Lines: 1457

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 8, 2024

Pull Request Test Coverage Report for Build eeb0c17dfbb5c461ce3bb6ae4669a1823da84362-PR-435

Details

  • 2 of 4 (50.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 87.577%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/mint/core/transport/ssl.ex 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
lib/mint/core/transport/ssl.ex 1 85.82%
Totals Coverage Status
Change from base Build f83b897ec3808cd871fa83140ac9d8aa5169b4c6: -0.2%
Covered Lines: 1276
Relevant Lines: 1457

💛 - Coveralls

Keyword.put(opts, :cacertfile, CAStore.file_path())
try do
Keyword.put(opts, :cacerts, :public_key.cacerts_get())
rescue
Copy link
Contributor

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?

Copy link
Contributor

@wojtekmach wojtekmach Jun 8, 2024

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.

@whatyouhide whatyouhide merged commit cec7786 into elixir-mint:main Jun 10, 2024
4 checks passed
@whatyouhide
Copy link
Contributor

@josevalim 1.6.1 is out 🙃

@wojtekmach
Copy link
Contributor

@whatyouhide v1.6.1 is out on GitHub but looks like not yet on Hex!

@wojtekmach
Copy link
Contributor

Thanks! I'm updating Finch accordingly: sneako/finch#274.

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

Successfully merging this pull request may close these issues.

4 participants