This repository was archived by the owner on Mar 7, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -412,7 +412,17 @@ public func installApp(from ipaURL: URL) throws {
412412 if status == errSecSuccess,
413413 let arr = items as? [ [ String : Any ] ] ,
414414 let first = arr. first,
415- let identityRef = first [ kSecImportItemIdentity as String ] as! SecIdentity
415+ if let identityRef = first [ kSecImportItemIdentity as String ] as? SecIdentity {
416+ // use identityRef as before
417+ if let secId = sec_identity_create ( identityRef) {
418+ tlsIdentity = secId
419+ tlsEnabled = true
420+ } else {
421+ print ( " sec_identity_create failed; falling back to HTTP " )
422+ }
423+ } else {
424+ print ( " Could not extract SecIdentity from PKCS12; falling back to HTTP " )
425+ }
416426 {
417427 // convert to sec_identity_t for sec_protocol_options_set_local_identity()
418428 // sec_identity_create is available on modern Apple SDKs — returns sec_identity_t?
You can’t perform that action at this time.
0 commit comments