Skip to content

Commit

Permalink
svn: work around certificate errors on macOS pre-10.15
Browse files Browse the repository at this point in the history
  • Loading branch information
EricFromCanada committed Oct 22, 2021
1 parent e518ea4 commit b99a4bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Library/Homebrew/download_strategy.rb
Expand Up @@ -763,7 +763,9 @@ def fetch_repo(target, url, revision = nil, ignore_externals: false, timeout: ni

args << "--ignore-externals" if ignore_externals

if meta[:trust_cert] == true
svn_version = Version.create(Utils::Svn.version)
if meta[:trust_cert] == true || svn_version <= Version.create("1.10")
args << "--trust-server-cert-failures=expired,not-yet-valid" if svn_version >= Version.create("1.9")
args << "--trust-server-cert"
args << "--non-interactive"
end
Expand Down
3 changes: 2 additions & 1 deletion Library/Homebrew/utils/svn.rb
Expand Up @@ -32,7 +32,8 @@ def remote_exists?(url)

# OK to unconditionally trust here because we're just checking if a URL exists.
system_command("svn", args: ["ls", url, "--depth", "empty",
"--non-interactive", "--trust-server-cert"], print_stderr: false).success?
"--trust-server-cert-failures=expired,not-yet-valid",
"--trust-server-cert", "--non-interactive"], print_stderr: false).success?
end

def clear_version_cache
Expand Down

0 comments on commit b99a4bd

Please sign in to comment.