Skip to content

Commit

Permalink
[fastlane_core] fix WWDR certificates import flow (#21442)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulTaykalo committed Aug 12, 2023
1 parent 4ac1d96 commit 239b738
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fastlane_core/lib/fastlane_core/cert_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def self.install_missing_wwdr_certificates

def self.install_wwdr_certificate(cert_alias)
url = WWDRCA_CERTIFICATES.find { |c| c[:alias] == cert_alias }.fetch(:url)
file = Tempfile.new(File.basename(url))
file = Tempfile.new([File.basename(url, ".cer"), ".cer"])
filename = file.path
keychain = wwdr_keychain
keychain = "-k #{keychain.shellescape}" unless keychain.empty?
Expand Down
4 changes: 2 additions & 2 deletions fastlane_core/spec/cert_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class ProcessStatusMock
`ls`

keychain = "keychain with spaces.keychain"
cmd = %r{curl -f -o (([A-Z]\:)?\/.+) https://www\.apple\.com/certificateauthority/AppleWWDRCAG6\.cer && security import \1 -k #{Regexp.escape(keychain.shellescape)}}
cmd = %r{curl -f -o (([A-Z]\:)?\/.+\.cer) https://www\.apple\.com/certificateauthority/AppleWWDRCAG6\.cer && security import \1 -k #{Regexp.escape(keychain.shellescape)}}
require "open3"

expect(Open3).to receive(:capture3).with(cmd).and_return(["", "", success_status])
Expand All @@ -124,7 +124,7 @@ class ProcessStatusMock
stub_const('ENV', { "FASTLANE_WWDR_USE_HTTP1_AND_RETRIES" => "true" })

keychain = "keychain with spaces.keychain"
cmd = %r{curl --http1.1 --retry 3 --retry-all-errors -f -o (([A-Z]\:)?\/.+) https://www\.apple\.com/certificateauthority/AppleWWDRCAG6\.cer && security import \1 -k #{Regexp.escape(keychain.shellescape)}}
cmd = %r{curl --http1.1 --retry 3 --retry-all-errors -f -o (([A-Z]\:)?\/.+\.cer) https://www\.apple\.com/certificateauthority/AppleWWDRCAG6\.cer && security import \1 -k #{Regexp.escape(keychain.shellescape)}}
require "open3"

expect(Open3).to receive(:capture3).with(cmd).and_return(["", "", success_status])
Expand Down

0 comments on commit 239b738

Please sign in to comment.