Hello,
My App is getting a Fence hang right after install in a specific scenario.
Issue1: I attempted to follow the directions, tried to symbolicate the file etc. however did not have much luck.
I was able to pinpoint the lines of code where the hang seems to occur. I did this using simple print and comment out/uncomment blocks of code related to the specific scenario. I was able to do so as, not much is happening on the Main thread in this scenario .
Issue 2: The following lines of code ( modified var etc. ) seem to cause the hang. Commenting them out gets rid of the hang across devices, while online/offline etc. I am not sure if I need to use a framework other than AVFoundation.
Note:
The file extension is mpg
The music files are static ( included in the Bundle ) and not accessed from user's playlist etc.
import
var plyr : AVAudioPlayer?
let pth = Bundle.main.path(forResource: "MusicFileName", ofType: "mpg")!
let url = URL(fileURLWithPath: pth)
do [{](https://www.example.com/)
plyr = try AVAudioPlayer(contentsOf: url)
plyr?.prepareToPlay()
plyr?.play()
} catch {
// print error etc.
}
Thanks in advance.
I would appreciate some help! Close to submission :)
Debugging
RSS for tagDiscover and resolve issues with your app.
Posts under Debugging tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I’ve built a iOS camera app that applies many CIFilters to an image captured by the camera. Some of my users have reported that on occasion the images have large parts that are blank, see below:
Frustratingly, I can’t reproduce this myself! Does anyone know what could he causing it, is it a memory issue? I haven’t posted the code as there’s a lot to look over and I’m not sure it would help diagnose it.
Thanks for any pointers.
Hi, everyone
I have an app already in production that uses SwiftUI's lifecycle (paired with an AppDelegate). Due to some specific behaviour of the app, we decided to migrate the app to use UIKit's lifecycle, adding the corresponding SceneDelegate to the app, as well as modifying the Info.plist file accordingly to accommodate to these new changes.
Although everything seems to work when installing the app from zero, when installing it on top of another version, the screen goes black and the user cannot interact with the app at all unless they reinstall it completely. As I've read online, iOS is reusing the window configuration from the previous execution of the app. I know this because the AppDelegate's application(application:connectingSceneSession:options) is not being called when coming from a previous version of the app.
I would love to know what can I do to make this work because, as you may understand, we cannot ask our user base to reinstall the application.
Thank you very much.
Hello everyone,
I’m experiencing a crash in my iOS application that’s occurring predominantly on devices running iOS 16.6.0. The crash seems to happen on the main thread during a UI operation, specifically within the UIKitCore framework.
Crash Log Summary
Thread 0 Crashed:
0 libsystem_kernel.dylib 0xca4 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x13b74 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x13e4c mach_msg_overwrite + 540
3 libsystem_kernel.dylib 0x11e8 mach_msg + 24
4 CoreFoundation 0x79024 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x7a250 __CFRunLoopRun + 1208
6 CoreFoundation 0x7f3ec CFRunLoopRunSpecific + 612
7 GraphicsServices 0x135c GSEventRunModal + 164
8 UIKitCore 0x39cf58 -[UIApplication _run] + 888
9 UIKitCore 0x39cbbc UIApplicationMain + 340
10 MyApp 0x24050 main + 51 (AppDelegate.swift:51)
11 ??? 0x1d3594dec (Missing)
I’ve attached the full crash
crashlog.txt
and would appreciate any insights or recommendations on how to resolve this issue.
Hi all. I've read all the posts related to CF_IS_OBJC, including this one, but since I don't have an Objective-C background and mostly work with Swift and SwiftUI, I'm struggling to fully understand the recommendations or how to address this issue. Could someone explain it to me in simple terms (like I'm 5) and provide a step-by-step guide on what to do? This crash has affected 66 devices over the past month.
Crashed: com.apple.main-thread
0 CoreFoundation 0xf878 CF_IS_OBJC + 24
1 CoreFoundation 0x17f58 CFArrayGetCount + 32
2 CoreGraphics 0x322a1c CGPDFTaggedNodeEnumerateChildren + 60
3 CoreGraphics 0x322880 CGPDFTaggedNodeGetBounds + 244
4 PDFKit 0x5524 -[UICGPDFNodeAccessibilityElement isAccessibilityElement]
5 UIAccessibility 0x48518 ___axuiElementForNotificationData_block_invoke + 28
6 UIAccessibility 0x35678 __94-[NSObject(AXPrivCategory) _accessibilityFindFirstAXDescendantPassingTest:byYieldingElements:]_block_invoke_2 + 36
7 UIAccessibility 0x3534c __96-[NSObject(AXPrivCategory) _accessibilityEnumerateAXDescendants:passingTest:byYieldingElements:]_block_invoke + 60
8 UIAccessibility 0x359d0 __57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke_2 + 60
9 UIAccessibility 0x1ec98 -[NSObject(AXPrivCategory) accessibilityEnumerateContainerElementsWithOptions:usingBlock:] + 548
10 UIAccessibility 0x35858 __57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke + 176
11 UIAccessibility 0x3539c __96-[NSObject(AXPrivCategory) _accessibilityEnumerateAXDescendants:passingTest:byYieldingElements:]_block_invoke + 140
12 UIAccessibility 0x359d0 __57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke_2 + 60
13 UIAccessibility 0x1ec98 -[NSObject(AXPrivCategory) accessibilityEnumerateContainerElementsWithOptions:usingBlock:] + 548
14 UIAccessibility 0x35858 __57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke + 176
15 UIAccessibility 0x3539c __96-[NSObject(AXPrivCategory) _accessibilityEnumerateAXDescendants:passingTest:byYieldingElements:]_block_invoke + 140
16 UIAccessibility 0x359d0 __57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke_2 + 60
17 UIAccessibility 0x1ec98 -[NSObject(AXPrivCategory) accessibilityEnumerateContainerElementsWithOptions:usingBlock:] + 548
18 UIAccessibility 0x35858 __57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke + 176
19 UIAccessibility 0x3539c __96-[NSObject(AXPrivCategory) _accessibilityEnumerateAXDescendants:passingTest:byYieldingElements:]_block_invoke + 140
20 UIAccessibility 0x359d0 __57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke_2 + 60
21 UIAccessibility 0x1ec98 -[NSObject(AXPrivCategory) accessibilityEnumerateContainerElementsWithOptions:usingBlock:] + 548
22 UIAccessibility 0x35858 __57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke + 176
23 UIAccessibility 0x3539c __96-[NSObject(AXPrivCategory) _accessibilityEnumerateAXDescendants:passingTest:byYieldingElements:]_block_invoke + 140
24 UIAccessibility 0x35918 __57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke + 368
25 UIAccessibility 0x3539c __96-[NSObject(AXPrivCategory) _accessibilityEnumerateAXDescendants:passingTest:byYieldingElements:]_block_invoke + 140
26 UIAccessibility 0x35294 -[NSObject _accessibilityEnumerateAXDescendants:passingTest:byYieldingElements:] + 244
27 UIAccessibility 0x355d0 -[NSObject _accessibilityFindFirstAXDescendantPassingTest:byYieldingElements:] + 272
28 UIAccessibility 0x35788 -[NSObject(AXPrivCategory) _accessibilityFindDescendant:] + 100
29 UIAccessibility 0x48280 _axuiElementForNotificationData + 276
30 UIAccessibility 0x347c _massageAssociatedElementBeforePost + 36
31 UIAccessibility 0x2648 _UIAXBroadcastMainThread + 292
32 libdispatch.dylib 0x213c _dispatch_call_block_and_release + 32
33 libdispatch.dylib 0x3dd4 _dispatch_client_callout + 20
34 libdispatch.dylib 0x125a4 _dispatch_main_queue_drain + 988
35 libdispatch.dylib 0x121b8 _dispatch_main_queue_callback_4CF + 44
36 CoreFoundation 0x56710 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
37 CoreFoundation 0x53914 __CFRunLoopRun + 1996
38 CoreFoundation 0x52cd8 CFRunLoopRunSpecific + 608
39 GraphicsServices 0x11a8 GSEventRunModal + 164
40 UIKitCore 0x40a90c -[UIApplication _run] + 888
41 UIKitCore 0x4be9d0 UIApplicationMain + 340
42 UIKitCore 0x638384 keypath_get_selector_hoverStyle + 11024
43 Wisconsin State Journal 0x3b4ae8 main + 4299246312 (AppDelegate.swift:4299246312)
44 ??? 0x1b7239e4c (Missing)
com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x1808 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x5008 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x4f20 mach_msg_overwrite + 436
3 libsystem_kernel.dylib 0x4d60 mach_msg + 24
4 CoreFoundation 0x53f5c __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x53600 __CFRunLoopRun + 1208
6 CoreFoundation 0x52cd8 CFRunLoopRunSpecific + 608
7 Foundation 0xc7e4c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8 Foundation 0xc7c9c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9 UIKitCore 0x41e640 -[UIEventFetcher threadMain] + 420
10 Foundation 0xde718 __NSThread__start__ + 732
11 libsystem_pthread.dylib 0x606c _pthread_start + 136
12 libsystem_pthread.dylib 0x10d8 thread_start + 8
com.google.firebase.crashlytics.MachExceptionServer
0 Wisconsin State Journal 0x83b668 FIRCLSProcessRecordAllThreads + 392 (FIRCLSProcess.c:392)
1 Wisconsin State Journal 0x83ba48 FIRCLSProcessRecordAllThreads + 423 (FIRCLSProcess.c:423)
2 Wisconsin State Journal 0x849c5c FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3 Wisconsin State Journal 0x84a460 FIRCLSMachExceptionServer + 521 (FIRCLSMachException.c:521)
4 libsystem_pthread.dylib 0x606c _pthread_start + 136
5 libsystem_pthread.dylib 0x10d8 thread_start + 8
Thread
0 libsystem_kernel.dylib 0x1808 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x5008 mach_msg2_internal + 80
...
In our app, we noticed that edit menus (i.e. when long pressing in a text field) have weird spacing inside each element. Which, as a result, causes the entire menu content to be truncated.
To be honest, I have no idea how this is being customized (to my understanding it shouldn't be?), but this is a relatively old and large app so something weird could possibly do it. I basically came here for guidance to see if anyone has thoughts on WHAT could possibly cause this customization / padding / resizing of each item, so I can fix it back to the system behavior.
Our app:
System:
Thanks for your help :)
Shai
Hello,
I am working on a MDM solution. I am facing issue to while Activation Unlock Iphone by MDM server. I am following this https://developer.apple.com/documentation/devicemanagement/device_assignment/activation_lock_a_device/creating_and_using_bypass_codes documentation as reference.
I am able to activation lock the device from mdm server but while unlocking the device I am getting below error
"?xml version="1.0" encoding="UTF-8"?>
ns:escrowKeyDeviceServicesResponse version="1" xmlns:ns="http://www.apple.com/cds/mdmescrowKeyDeviceServices/xml">
error code="1002" message="com.apple.cds.cyclops.mdm.MDMServiceException: No registered escrow key found"/>
/ns:escrowKeyDeviceServicesResponse>"
I am sending below request for Unlock
Url=https://deviceservices-external.apple.com/deviceservicesworkers/escrowKeyUnlock?Device_Serial=XXXXXXXX&productType=iPhone12,8&imei=XXXXXXX&imei2=XXXXXXXXXXXXXX&meid=XXXXXXXXXX
Body=escrowKey=VT2DK-YR647-HWAY-096C-ER7P-89J1&orgName=ORGNAME&guid=9C1AE0D42A38A23AFFE59
Below working request for Activation Lock
URL=https://mdmenrollment.apple.com/device/activationlock
Body =
{
"Device" :"Serial_Number",
"EscrowKey" :"B83C6E662299F3AF202656C4D7A434A319A34241A2892792132EECE56F6D898A",
"LostMessage":"Message"
}
Any idea what could cause this error.
The exact error reported is :
CGImageSourceGetStatus:4839: *** ERROR: invalid CGImageSourceRef (non-matching hint)
at runtime.
The app is using static images included in the bundle and loads image views. It works fine and has no image errors. Is this log noise?
I came across several "errors" being reported when I run my app, however my app seems to function correctly.
I believe they fall in the category listed on this ( now locked ) thread https://developer.apple.com/forums/thread/115461
However, I wanted to post the ones I found to clarify ( close to submission) just in case any of these end up being more than just log noise later. PLEASE let me know if you've come across these before and whether they impacted anything or if you can confirm they are just log noise. Thanks in advance!
-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = , customInfoType = UIEmojiSearchOperations
AVAudioSession_iOS.mm:2,223 Server returned an error from destroySession:. Error Domain=NSCocoaErrorDomain Code=4099 “The connection to service with pid 102 named com.apple.audio.AudioSession was invalidated from this process.” UserInfo={NSDebugDescription=The connection to service with pid 102 named com.apple.audio.AudioSession was invalidated from this process.
CAReportingClient.mm:532 Attempted to remove a reporter not created by this client { careporter_id=408,331,130,765,320 }
load_eligibility_plist: Failed to open //private/var/db/os_eligibility/eligibility.plist: Operation not permitted(1) - I verified and this file is indeed in non read mode on my Mac for the user. However it affects nothing.
The following 2 pop up - although I have no explicit code or 3P code ( nor Ads) that require impressions - each time I click on the Game Center Access Point post authentication.
Cannot add impressions because no tracker is specified by the metrics fields context. Did you forget to set one from your view controller or data source?
Cannot add page fields because none are specified by the metrics fields context. Did you forget to add an PageMetricsPresenter to the object graph used for actions?
It's working well on iOS 17 simulator and device. but crashes on iOS 18 beta. It looks like it crashes on a UIviewcontroller page with a UIcollectionView.
Here's a video clearly demonstrating the problem:
https://youtu.be/-IbyaaIzh0I
This is a major issue for my game, because it's not meant to be played multiple times. My game is designed to only play once, so it really ruins the experience if it runs poorly until someone force quits or crashes the game.
Does anyone have a solution to this, or has encountered this issue of poor initial launch performance?
I made this game in Unity and I'm not sure if this is an Apple issue or a Unity issue.
So, I've requested my app to be published to the App store. I am new to apple development, so I don't know what the crash log really says nor how it would apply to my code. The app works on my Xcode simulators and my own device, but according to apple it fails on startup?
Apparently, crash report is too big to post, so here is my App Delegate:
//
// AppDelegate.swift
// YorkCougars
//
// Created by ADMIN on 8/13/24.
//
import Foundation
import SwiftUI
import WebKit
import FirebaseCore
import FirebaseAuth
import FirebaseMessaging
class AppDelegate:NSObject,UIApplicationDelegate,UNUserNotificationCenterDelegate, MessagingDelegate{
func registerForNoti(application:UIApplication){
UNUserNotificationCenter.current().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
options: authOptions,
completionHandler: { _, _ in }
)
application.registerForRemoteNotifications()
}
func application(_ application:UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil)-> Bool{
FirebaseApp.configure()
DatabaseHandler.onStart()
DatabaseHandler.startObservingAll()
registerForNoti(application: application)
Messaging.messaging().delegate = self
Messaging.messaging().subscribe(toTopic: "QUARTER")
Messaging.messaging().subscribe(toTopic: "ALL")
//Messaging.messaging().subscribe(toTopic: "DEV")
DatabaseHandler.observe(fromRootLocation: "refreshrate"){snapshot in
gl.shared.reload = true
gl.shared.sbURL = "?r=\(snapshot.value as? Int ?? 0)"
print("lol")
}
return true;
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
{
Messaging.messaging().setAPNSToken(deviceToken, type: .unknown)
}
}
extension AppDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
let userInfo = notification.request.content.userInfo
Messaging.messaging().appDidReceiveMessage(userInfo)
// Change this to your preferred presentation option
completionHandler([[.banner, .list, .sound]])
}
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
let userInfo = response.notification.request.content.userInfo
Messaging.messaging().appDidReceiveMessage(userInfo)
completionHandler()
}
func application(_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable : Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
Messaging.messaging().appDidReceiveMessage(userInfo)
completionHandler(.noData)
}
}
For a few reasons, we as a team decided to transition away from the SwiftUI.App launch cycle. We need more control and customisation, and managing the scenes directly ourselves was the best way forward.
We're now trying to run the app entirely from our own App and Scene delegates, however we've run into a problem: When we update the app on a device from a version that uses SwiftUI.App to a version that uses App and Scene delegates, the first initial launch fails with a black screen.
The reason for this is that FrontBoardServices attempts to use the existing UISceneSession after the update, with the SwiftUI.AppSceneDelegate class, instead of calling application(configurationForConnecting:options:). Since SwiftUI.AppSceneDelegate still exists in the scope, the internal property _configurationNeedsReevaluation on UISceneSession returns false and the app attempts to launch from SwiftUI.AppSceneDelegate.
As far as I can tell, there doesn't seem to be a way to fix this that doesn't involve invoking the private method -[UISceneSession _updateConfiguration:] to force the configuration to use the correct Scene delegate.
if let sceneSession = application.openSessions.first(
where: { $0.configuration.delegateClass.map(NSStringFromClass) == "SwiftUI.AppSceneDelegate" }
) {
let newConfig = UISceneConfiguration(name: nil, sessionRole: .windowApplication)
newConfig.delegateClass = SceneDelegate.self
sceneSession.perform(Selector(("_updateConfiguration:")), with: newConfig)
}
Could you maybe advise on a way forwards?
Bug
When you try to extend from NSViewRepresentable but you have a class named Context swift throws a error message that doesn't help at all.
Type 'MetalViewRepresentable' does not conform to protocol 'NSViewRepresentable'
Steps to reproduce
Create a MacOS App
Copy this code
struct MetalViewRepresentable: NSViewRepresentable {
@Binding var metalView: MTKView
func makeNSView(context: Context) -> some NSView {
metalView
}
func updateNSView(_ uiView: NSViewType, context: Context) {
}
}
Write this line of code in any file
class Context {}
Hello everyone, I'm releasing an Expo React Native app for Android and iOS.
The Android release went well, but the iOS build crashes when opening in Testflight and the submission to Appstore crashes as per the review feedback. When I run it locally with ExpoGo it works as expected.
Im not experienced in iOS development and my research didn't give me any concrete answers, a hint may be that on the JS code somewhere an object is being used as a boolean in a condition.
Can someone point me to the nature of this issue so I can continue debugging?
This is the crash log on Xcode when i create a new release:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM boolValue]: unrecognized selector sent to instance 0x600000230300'
*** First throw call stack:
(
0 CoreFoundation 0x00000001804ae138 __exceptionPreprocess + 172
1 libobjc.A.dylib 0x0000000180087db4 objc_exception_throw + 56
2 CoreFoundation 0x00000001804c2f88 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x00000001804b2288 forwarding + 1280
4 CoreFoundation 0x00000001804b45ac _CF_forwarding_prep_0 + 92
5 ColineleTransilvaniei 0x0000000104e6abbc __41-[RCTModuleMethod processMethodSignature]_block_invoke_12 + 68
6 ColineleTransilvaniei 0x0000000104e6bd88 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 292
7 ColineleTransilvaniei 0x0000000104e6ded0 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicEiN12_GLOBAL__N_117SchedulingContextE + 456
8 ColineleTransilvaniei 0x0000000104e6db28 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 112
9 libdispatch.dylib 0x00000001070d7ec4 _dispatch_call_block_and_release + 24
10 libdispatch.dylib 0x00000001070d973c _dispatch_client_callout + 16
11 libdispatch.dylib 0x00000001070e1a30 _dispatch_lane_serial_drain + 916
12 libdispatch.dylib 0x00000001070e2774 _dispatch_lane_invoke + 420
13 libdispatch.dylib 0x00000001070ef1a8 _dispatch_root_queue_drain_deferred_wlh + 324
14 libdispatch.dylib 0x00000001070ee604 _dispatch_workloop_worker_thread + 488
15 libsystem_pthread.dylib 0x0000000105b1b814 _pthread_wqthread + 284
16 libsystem_pthread.dylib 0x0000000105b1a5d4 start_wqthread + 8
)
libc++abi: terminating due to uncaught exception of type NSException
PS: I failed to Symbolicate the crash logs as well, but will try again
Like my post title?
I'm having issues getting my app accepted by the app store. I keep getting the message:
Guideline 2.5.1 - Performance - Software Requirements
Your app's binary includes references to HealthKit components, but the app does not appear to include any primary features that require health or fitness data.
I don't have healthkit implemented anywhere in my app. I sifted through my app and:
Healthkit is not implemented in my infoplist
There are no HK imports
My app doesn't reveal any references to "Health Kit" when I do a project wide search.
The only thing I can think of is that there's an issue with my use of firebase. I'm wondering if I somehow inserted healthkit functionality in to firebase accidentally.
Has anyone else had this problem before? If so, how did you solve it? Also. How do you rid of healthkit functionality or references to healthkit within firebase?
I created a demo Xcode project, it can reproduce the crash easily.
Please follow the 'STEPS TO REPRODUCE THE CRASH' below:
Archive the demo project with Release configuration and Xcode15.3 or later versions
Export ipa with adhoc.
Install it on your real devices(iPhone or iPad).
Launch the app.
Press 'Parse PDF' button, then App will crash.
Hello, we are developing an application that uses TLS client authentication with self-signed certificate. The app has multiple targets, including iOS and macOS clients. However, we are encountering issues with the client certificate on both platforms. Specifically, the client certificate is being rejected when making a URLRequest, and an AuthChallenge is triggered. The strange part is that the TLS handshake fails for every target except one iOS target, making it unclear whether the issue lies with the server or the system.
Flow
The connection uses TLS with Client Authentication. User is authenticated by client certificate, that is issued when user signs in. The certificate is self-signed. It is decoded from PKCS#12 blob into Swift.Data and then successfully imported with SecPKCS12Import. The Keychain uses access groups (separate for each target), kSecAttrSynchronizable is set to false and the items are accessible .afterFirstUnlock.
The certificate is used for two types of connections - 1) Basic query request 2) Periodic status report
First type of request never fails - it is successful, the problem arises with second type of requests.
If the certificate is expired on didReceive challenge: URLAuthenticationChallenge, it is refreshed and then provided for verification with URLCredential
Issue
With default target everything works as expected. The issue arose when another targets with the same functionality (Different UI, Access Group, Bundle identifier) were added (different xcodeproj or same). Importing certificate is successful as are basic query requests. The issue are with the second type of requests - Periodic status report. Whenever this request is sent via URLSession, it fails.
Here is the output in Xcode console:
- boringssl_context_handle_fatal_alert(2072) [C1.1.1.1:2][0x13c0755a0] read alert, level: fatal, description: bad certificate
- nw_read_request_report [C1] Receive failed with error "bad certificate format"
- boringssl_session_handshake_error_print(44) [C1.1.1.1:2][0x13c0755a0] Error: 5266350496:error:10000412:SSL routines:OPENSSL_internal:SSLV3_ALERT_BAD_CERTIFICATE:/AppleInternal/Library/BuildRoots/a8fc4767-fd9e-11ee-8f2e-b26cde007628/Library/Caches/com.apple.xbs/Sources/boringssl/ssl/tls_record.cc:592:SSL alert number 42
- “Task <..>.<1> finished with error [-1202] Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “<redacted>” which could put your confidential information at risk.”“
The certificate is in fact not invalid, since it works as expected for the other type of request and with the one specific target
Here is the output from Console.app
consoleoutput.txt
I also noticed an additional error when I specifically searched for errors in Console.app. I'm not sure if it's connected, though it doesn't seem likely, as this error appears far more frequently than the requests.
| Security | com.apple.security | trustd | SecKeyVerifySignature failed: Error Domain=NSOSStatusErrorDomain Code=-67808 "RSA signature verification failed, no match" UserInfo={numberOfErrorsDeep=0, NSDescription=RSA signature verification failed, no match} debug 21:56:54.822609+0200
| Security | com.apple.security | trustd | SecKeyVerifySignature failed: Error Domain=NSOSStatusErrorDomain Code=-50 "rsa_pub_crypt failed, ccerr=-7" (paramErr: error in user parameter list) UserInfo={numberOfErrorsDeep=0, NSDescription=rsa_pub_crypt failed, ccerr=-7} debug 21:56:43.954898+0200
On iOS an additional error appears.
SecKeyVerifySignature failed: Error Domain=NSOSStatusErrorDomain Code=-50 "<SecKeyRef algorithm id: 1, key type: RSAPublicKey, version: 4, 2048 bits (block size: 256), exponent: {hex: 10001, decimal: 65537}, modulus: F12EA3…97D85C5, addr: 0x7eca128c0>: sign - input buffer bad size (264 bytes)" UserInfo={numberOfErrorsDeep=0, NSDescription=<SecKeyRef algorithm id: 1, key type: RSAPublicKey, version: 4, 2048 bits (block size: 256), exponent: {hex: 10001, decimal: 65537}, modulus: F12EA31…A835FA7B
With the message that says, "The certificate for this server is invalid...," it appears that the server certificate is failing. However, as mentioned, it works for another target that uses the exact same endpoint. When making a simple GET request to this endpoint, it passes as expected, probably since client certificate is not requested. I also checked the trust result on AuthenticationChallenge and it was successful.
Could this be an issue with the client/server certificate itself? Or perhaps with how the client certificate is being handled—such as storing it inside the keychain, possible collisions? Thank you for your response.
I've a simple Applescript script as following:
tell application "Terminal"
-- Get the current tab
set currentTab to selected tab of first window
-- Set the current tab's theme to Homebrew
set currentTab's current settings to settings set "Homebrew"
end tell
which works as expected when Terminal is run as a "normal" window, but fails with the following error when in Split View
terminal-color.scpt: execution error: Terminal got an error: AppleEvent handler failed. (-10000)
Any way to work around this error?
After install iOS 18 beta 4 the Ridmik keyboard doesn’t work properly. When I go to write something with this keyboard it’s shaking continually. Basically using this Ridmik Keyboard for Bangla typing.
Here is problem screenshot. Look at this phots keyboard. Phone model is iPhone 12 Pro