Skip to content

Commit be95e65

Browse files
Mikhail Yurovcursoragent
authored andcommitted
Fix OpenSSL 3: add -legacy flag for Apple p12 (RC2-40-CBC) on macos-26
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d4bda20 commit be95e65

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

β€Ž.github/workflows/release-ios.ymlβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ jobs:
172172
fi
173173
174174
# Test 1: Check for PRIVATE KEY in p12 structure
175+
# -legacy: OpenSSL 3.x on macos-26 disables RC2-40-CBC; Apple p12 often uses it
175176
echo "πŸ“‹ Test 1: Checking p12 structure for private key..."
176-
CERT_CONTENTS=$(openssl pkcs12 -in cert.p12 -nodes -passin env:IOS_P12_PASSWORD 2>&1)
177+
CERT_CONTENTS=$(openssl pkcs12 -in cert.p12 -legacy -nodes -passin env:IOS_P12_PASSWORD 2>&1)
177178
OPENSSL_EXIT=$?
178179
set -e
179180
@@ -182,8 +183,7 @@ jobs:
182183
echo ""
183184
echo "Output: $CERT_CONTENTS"
184185
echo ""
185-
echo "πŸ’‘ Most likely: wrong IOS_P12_PASSWORD. Ensure the secret matches the p12 password."
186-
echo " If password has special chars, try re-exporting the p12 with a simpler password."
186+
echo "πŸ’‘ Possible causes: wrong IOS_P12_PASSWORD, or OpenSSL 3 on macos-26 (we use -legacy for Apple p12)"
187187
exit 1
188188
fi
189189
@@ -199,7 +199,7 @@ jobs:
199199
# Test 2: Check if private key can be extracted (nocerts flag) - informational only
200200
echo ""
201201
echo "πŸ“‹ Test 2: Attempting to extract private key only (nocerts)..."
202-
if openssl pkcs12 -in cert.p12 -nocerts -passin pass:"$IOS_P12_PASSWORD" >/dev/null 2>&1; then
202+
if openssl pkcs12 -in cert.p12 -legacy -nocerts -passin pass:"$IOS_P12_PASSWORD" >/dev/null 2>&1; then
203203
echo "βœ… Private key can be extracted separately"
204204
else
205205
echo "⚠️ Note: nocerts extraction failed (this is OK if Test 1 passed)"
@@ -208,7 +208,7 @@ jobs:
208208
# Test 3: Alternative private key check using env variable - informational only
209209
echo ""
210210
echo "πŸ“‹ Test 3: Alternative private key extraction test..."
211-
if openssl pkcs12 -in cert.p12 -nocerts -passin env:IOS_P12_PASSWORD >/dev/null 2>&1; then
211+
if openssl pkcs12 -in cert.p12 -legacy -nocerts -passin env:IOS_P12_PASSWORD >/dev/null 2>&1; then
212212
echo "βœ… Alternative extraction succeeded"
213213
else
214214
echo "⚠️ Note: Alternative extraction failed (this is OK if Test 1 passed)"

β€Žfastlane/Fastfileβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ platform :ios do
4343

4444
# Check certificate details from the p12
4545
UI.important "πŸ” Certificate details from p12 file:"
46-
sh("openssl pkcs12 -in '#{cert_path}' -passin pass:'#{ENV['IOS_P12_PASSWORD']}' -nokeys 2>&1 | openssl x509 -noout -subject -dates -fingerprint") rescue UI.message("Could not read p12")
46+
sh("openssl pkcs12 -in '#{cert_path}' -legacy -passin pass:'#{ENV['IOS_P12_PASSWORD']}' -nokeys 2>&1 | openssl x509 -noout -subject -dates -fingerprint") rescue UI.message("Could not read p12")
4747

4848
# Check for private key in keychain
4949
UI.important "πŸ” Checking for private keys in keychain:"

0 commit comments

Comments
Β (0)