Skip to content

Commit c88c0f8

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

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/mix/lib/mix/utils.ex

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,15 @@ 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+
663+
ssl_options = [
664+
verify: :verify_peer,
665+
cacerts: :public_key.cacerts_get(),
666+
customize_hostname_check: [match_fun: :public_key.pkix_verify_hostname_match_fun(:https)]
667+
]
660668

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

0 commit comments

Comments
 (0)