Skip to content

Commit ed9fcd9

Browse files
committed
Inline :httpc.ssl_verify_host_options/1 for now
1 parent 2ad01b1 commit ed9fcd9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/mix/lib/mix/utils.ex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,14 @@ defmodule Mix.Utils do
656656
request = {:binary.bin_to_list(path), headers}
657657

658658
# Use the system certificates
659-
ssl_options = :httpc.ssl_verify_host_options(true)
659+
# Currently we inline what `:httpc.ssl_verify_host_options/1` is doing,
660+
# it is because not present on OTP 25.0.
661+
# TODO: just do `ssl_options = :httpc.ssl_verify_host_options(true)` once OTP >= 26.0 is required.
662+
ssl_options = [
663+
verify: :verify_peer,
664+
cacerts: :public_key.cacerts_get(),
665+
customize_hostname_check: [match_fun: :public_key.pkix_verify_hostname_match_fun(:https)]
666+
]
660667

661668
# We are using relaxed: true because some servers is returning a Location
662669
# header with relative paths, which does not follow the spec. This would

0 commit comments

Comments
 (0)