"StoreKit Testing in Xcode" certificate is not trusted on iOS 26

Hello.

I have setup a StoreKit testing in the app that was and still is perfectly working on iOS 18.

Unfortunately when run on iOS 26 the following error gets printed in the console after calling Transaction.currentEntitlement(for:) method:

Failed to verify certificate chain due to client recoverable failure:
Error Domain=NSOSStatusErrorDomain Code=-67843 "“StoreKit Testing in Xcode” certificate is not trusted" UserInfo={NSLocalizedDescription=“StoreKit Testing in Xcode” certificate is not trusted, NSUnderlyingError=0x109de7e10 {Error Domain=NSOSStatusErrorDomain Code=-67843 "Certificate 0 “StoreKit Testing in Xcode” has errors: Root is not trusted;" UserInfo={NSLocalizedDescription=Certificate 0 “StoreKit Testing in Xcode” has errors: Root is not trusted;}}}

I'm not seeting any StoreKit Testing certificates in phone's certificate trust settings.

This test was performed on iOS 26.0 (23A341) with app built in Xcode 16.4.

FB20339145

Answered by RenGate in 912380022

Apple replied to FB25081130 saying that it was fixed in 27.2. My testing has shown that 27.2 indeed fixed this issue.

It only happened in a single simulator, while others were intact. I did the reset of that particular simulator and the issue went away.

Just the night before the issue, my mac crashed and the shutdown stall file appeared in the DiagnosticReports folder

My original report was closed with notice that the issue has been fixed in iOS 27 beta 4. Unfortunately, while running iOS 27.0.1, I recently encountered this problem once again, but with a slightly different error message.

Failed to verify certificate chain due to client recoverable failure:
Error Domain=NSOSStatusErrorDomain Code=-67818 "“StoreKit Testing in Xcode” certificate is expired" UserInfo={NSLocalizedDescription=“StoreKit Testing in Xcode” certificate is expired, NSUnderlyingError=0x11ba5ef40 {Error Domain=NSOSStatusErrorDomain Code=-67818 "Certificate 0 “StoreKit Testing in Xcode” has errors: Certificate is not temporally valid;" UserInfo={NSLocalizedDescription=Certificate 0 “StoreKit Testing in Xcode” has errors: Certificate is not temporally valid;}}}

I managed to obtain the faulty certificate used by the OS using the following code and that certificate was indeed expired.

if let jws = try? await AppTransaction.shared.jwsRepresentation {
    var header = String(jws.split(separator: ".")[0])
        .replacingOccurrences(of: "-", with: "+")
        .replacingOccurrences(of: "_", with: "/")
    header += String(repeating: "=", count: (4 - header.count % 4) % 4)
    if let headerData = Data(base64Encoded: header),
       let json = try? JSONSerialization.jsonObject(with: headerData) as? [String: Any],
       let chain = json["x5c"] as? [String],
       let der = Data(base64Encoded: chain[0]) {
        let url = URL.temporaryDirectory.appending(path: "StoreKitTestingInXcode.cer")
        try? der.write(to: url)
        print("Certificate written to \(url.path())")
    }
}

Looks like there's a bug in iOS preventing it from creating a new certificate. The same issue with a different certificate was also observed on macOS 26.6 with a Catalyst app. I don't have any expired certificates in my Keychain, so it looks like this problematic certificate can't be deleted by the user alone.

New report: FB25081130

I'm also having this problem on iOS 27.0.1. With the same: "StoreKit Testing in Xcode certificate is expired"

I'm experiencing the same issue on iOS 27.0.1 on my iPhone 17 Pro. The certificate expired three days ago, and I haven't found a way to renew it.

I confirmed the expiration date by inspecting the certificate embedded in AppTransaction.shared.jwsRepresentation. Even newly created StoreKit transactions are signed with the expired certificate.

The issue affects two different apps on the same iPhone, using different StoreKit configuration files. Both work correctly on my iPad Pro. I've also reproduced the issue with Xcode 26.6, 27.0, and 27.1.

Restarting the iPhone, resetting transactions, and clearing Xcode's StoreKit caches didn't help.

I'm also getting the same error when using a StoreKit Configuration File with an iOS Swift app:

Failed to verify certificate chain due to client recoverable failure:
Error Domain=NSOSStatusErrorDomain Code=-67818 "“StoreKit Testing in Xcode” certificate is expired" UserInfo={NSLocalizedDescription=“StoreKit Testing in Xcode” certificate is expired, NSUnderlyingError=0x10af05830 {Error Domain=NSOSStatusErrorDomain Code=-67818 "Certificate 0 “StoreKit Testing in Xcode” has errors: Certificate is not temporally valid;" UserInfo={NSLocalizedDescription=Certificate 0 “StoreKit Testing in Xcode” has errors: Certificate is not temporally valid;}}}

This error only happens on one real device (iPhone). The code works OK on the simulator and when not using a StoreKit Configuration File. Deleting the app on the device and re-running via XCode doesn't resolve the issue. It does look like a root certificate has expired somewhere but can't see how to force it to be re-created.

Accepted Answer

Apple replied to FB25081130 saying that it was fixed in 27.2. My testing has shown that 27.2 indeed fixed this issue.

Yes, I installed 27.2 on my iPhone today and that also fixed the issue for me. 🎉

Confirmed, iOS 27.2 also fixed it for me.