TL;DR I cannot install some Apple software because a certificate appears to have expired. How do I identify the culprit?
I have been using Xcode 10.1 on 10.13.6 for a many years on my MacBook Pro, and suddenly it won't launch any more because it wants to install the "additional required components", but then fails at doing so with a weird "untrusted" error message.
From the log file:
Xcode[12324]: Package Authoring Error: PackageInfo bundle reference found without top-level bundle
definition. Bundle will be skipped: <bundle id="*"></bundle>
Xcode[12324]: Package: PKLeopardPackage <id=com.apple.pkg.MobileDeviceDevelopment,
version=10.3.9000000000.1.1488876279,
url=file:///Applications/Xcode10.1.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg>
Failed to verify with error: Error Domain=PKInstallErrorDomain Code=102 "The package
“MobileDeviceDevelopment.pkg” is untrusted." UserInfo={NSLocalizedDescription=The package
“MobileDeviceDevelopment.pkg” is untrusted., NSURL=MobileDeviceDevelopment.pkg --
file:///Applications/Xcode10.1.app/Contents/Resources/Packages/,
PKInstallPackageIdentifier=com.apple.pkg.MobileDeviceDevelopment, NSUnderlyingError=0x7f8240512710
{Error Domain=NSOSStatusErrorDomain Code=-2147409654 "CSSMERR_TP_CERT_EXPIRED"
UserInfo={SecTrustResult=5, PKTrustLevel=PKTrustLevelExpiredCertificate,
NSLocalizedFailureReason=CSSMERR_TP_CERT_EXPIRED}}}
Everything else works fine on the system. All I changed recently, before this started happening, was to re-install 10.13.6 fresh, and then restore from a recent Time Machine backup, all in order to fix an iCloud issue that seemed to be related to SSL trust issues when contacting the iCloud sync server, but was fixed with this re-install.
I've even re-downloaded the Xcode10.1.xip from Apple, but that makes no differences, it's not Xcode that's broken.
The log suggests that a cert has expired, but which one would that be? I have looked at the Certificates in Keychain Access, but none of the ones that appear to be related to Apple are expired as far as I can tell. Maybe one is missing, but which?
Any ideas how to analyse or fix this?
(I need Xcode 10.1 because the macOS apps I make need to remain backward compatible with 10.11 and up, and I'm often debugging on High Sierra for that purpose. Besides, the same Xcode 10.1 works fine on two other Macs running 10.13.6.)