Fix OpenSSL 3.x EC key parsing in Fastfile

Fastlane 2.234.0 uses OpenSSL::PKey::EC.new which fails with "invalid
curve name" on PKCS#8 keys under OpenSSL 3.x. Add monkey-patch to fall
back to OpenSSL::PKey.read which handles both formats.
This commit is contained in:
Adam Moussa 2026-05-18 19:22:46 -04:00
parent efa77c6ce7
commit e355809b58

View file

@ -1,3 +1,23 @@
require 'openssl'
# Workaround: fastlane 2.234.0 uses OpenSSL::PKey::EC.new which fails on
# PKCS#8 keys with OpenSSL 3.x ("invalid curve name"). Fallback to PKey.read.
module OpenSSL
module PKey
class EC
class << self
alias_method :_orig_new, :new
def new(*args)
_orig_new(*args)
rescue OpenSSL::PKey::ECError
raise unless args.length == 1 && args[0].is_a?(String)
OpenSSL::PKey.read(args[0])
end
end
end
end
end
default_platform(:ios)
platform :ios do