Skip to content

Commit

Permalink
revert setting --insecure to download ca-certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
EricFromCanada committed Nov 24, 2024
1 parent 3b1d59d commit 1185b26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
14 changes: 6 additions & 8 deletions Library/Homebrew/cmd/vendor-install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Documentation defined in Library/Homebrew/cmd/vendor-install.rb

# HOMEBREW_CURLRC, HOMEBREW_LIBRARY is from the user environment
# HOMEBREW_CACHE, HOMEBREW_CURL, HOMEBREW_LINUX, HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION, HOMEBREW_MACOS,
# HOMEBREW_MACOS_VERSION_NUMERIC and HOMEBREW_PROCESSOR are set by brew.sh
# HOMEBREW_ARTIFACT_DOMAIN, HOMEBREW_ARTIFACT_DOMAIN_NO_FALLBACK, HOMEBREW_BOTTLE_DOMAIN, HOMEBREW_CACHE,
# HOMEBREW_CURLRC, HOMEBREW_DEVELOPER, HOMEBREW_DEBUG, HOMEBREW_VERBOSE are from the user environment
# HOMEBREW_PORTABLE_RUBY_VERSION is set by utils/ruby.sh
# HOMEBREW_LIBRARY, HOMEBREW_PREFIX are set by bin/brew
# HOMEBREW_CURL, HOMEBREW_GITHUB_PACKAGES_AUTH, HOMEBREW_LINUX, HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION, HOMEBREW_MACOS,
# HOMEBREW_PHYSICAL_PROCESSOR, HOMEBREW_PROCESSOR, HOMEBREW_USER_AGENT_CURL are set by brew.sh
# shellcheck disable=SC2154
source "${HOMEBREW_LIBRARY}/Homebrew/utils/lock.sh"
source "${HOMEBREW_LIBRARY}/Homebrew/utils/ruby.sh"
Expand Down Expand Up @@ -129,11 +132,6 @@ fetch() {
curl_args[${#curl_args[*]}]="--progress-bar"
fi

if [[ "${HOMEBREW_MACOS_VERSION_NUMERIC}" -lt "100600" ]]
then
curl_args[${#curl_args[*]}]="--insecure"
fi

temporary_path="${CACHED_LOCATION}.incomplete"

mkdir -p "${HOMEBREW_CACHE}"
Expand Down
8 changes: 0 additions & 8 deletions Library/Homebrew/download_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,6 @@ def _curl_args

args += meta.fetch(:headers, []).flat_map { |h| ["--header", h.strip] }

if meta[:insecure]
unless @insecure_warning_shown
opoo DevelopmentTools.insecure_download_warning("an updated certificates file")
@insecure_warning_shown = true
end
args += ["--insecure"]
end

args
end

Expand Down
12 changes: 1 addition & 11 deletions Library/Homebrew/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,9 @@ def owner=(owner)
@owner = owner
patches.each { |p| p.owner = owner }

return if !owner.respond_to?(:full_name) || owner.full_name != "ca-certificates"
return if Homebrew::EnvConfig.no_insecure_redirect?

@insecure = !specs[:bottle] && (DevelopmentTools.ca_file_substitution_required? ||
DevelopmentTools.curl_substitution_required?)
return if @url.nil?

specs = if @insecure
@url.specs.merge({ insecure: true })
else
@url.specs.except(:insecure)
end
@url = URL.new(@url.to_s, specs)
@url = URL.new(@url.to_s, @url.specs)
end

# Removes /s from resource names; this allows Go package names
Expand Down

0 comments on commit 1185b26

Please sign in to comment.