Skip to content

Commit a8823ef

Browse files
committed
Remove application callback and persistent_term check
persistent_term has been available since OTP 21.2 and Mint requires Elixir ~> 1.12 which needs OTP 22+, so it is always available. Remove the runtime check, the application env, and the empty supervisor.
1 parent 042b248 commit a8823ef

3 files changed

Lines changed: 9 additions & 29 deletions

File tree

lib/mint/application.ex

Lines changed: 0 additions & 14 deletions
This file was deleted.

lib/mint/core/transport/ssl.ex

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -601,18 +601,14 @@ defmodule Mint.Core.Transport.SSL do
601601
end
602602

603603
defp get_cacertfile(path) do
604-
if Application.get_env(:mint, :persistent_term) do
605-
case :persistent_term.get({:mint, {:cacertfile, path}}, :error) do
606-
{:ok, cacerts} ->
607-
cacerts
608-
609-
:error ->
610-
cacerts = decode_cacertfile(path)
611-
:persistent_term.put({:mint, {:cacertfile, path}}, {:ok, cacerts})
612-
cacerts
613-
end
614-
else
615-
decode_cacertfile(path)
604+
case :persistent_term.get({:mint, {:cacertfile, path}}, :error) do
605+
{:ok, cacerts} ->
606+
cacerts
607+
608+
:error ->
609+
cacerts = decode_cacertfile(path)
610+
:persistent_term.put({:mint, {:cacertfile, path}}, {:ok, cacerts})
611+
cacerts
616612
end
617613
end
618614

mix.exs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ defmodule Mint.MixProject do
1616
# Xref
1717
xref: [
1818
exclude: [
19-
:persistent_term,
2019
{:ssl, :cipher_suites, 1},
2120
{:public_key, :cacerts_get, 0},
2221
CAStore
@@ -54,8 +53,7 @@ defmodule Mint.MixProject do
5453
# Run "mix help compile.app" to learn about applications.
5554
def application do
5655
[
57-
extra_applications: [:logger, :ssl],
58-
mod: {Mint.Application, []}
56+
extra_applications: [:logger, :ssl]
5957
]
6058
end
6159

0 commit comments

Comments
 (0)