Sewaktu install aplikasi di macOS muncul pesan error berikut ini

2023-03-22 15:10:02+01 devops-mac-thailand-farm installd[14266]: Package: PKLeopardPackage <id=org.superapp.1.0.0, version=1.0.0, url=file://localhost/Users/devops/.Trash/my-super-app.pkg#superapp.pkg> Failed to verify with error: Error Domain=PKInstallErrorDomain Code=102 "The package “my-super-app.pkg” is untrusted." UserInfo={NSLocalizedDescription=The package “my-super-app.pkg” is untrusted., NSURL=file://localhost/Users/devops/.Trash/my-super-app.pkg#superapp.pkg, PKInstallPackageIdentifier=org.superapp.1.0.0, NSUnderlyingError=0x12921c350 {Error Domain=NSOSStatusErrorDomain Code=-2147409622 "CSSMERR_TP_NOT_TRUSTED" UserInfo={SecTrustResult=5, PKTrustLevel=PKTrustLevelNotTrusted, NSLocalizedFailureReason=CSSMERR_TP_NOT_TRUSTED}}}
2023-03-22 15:10:02+01 devops-mac-thailand-farm installd[14266]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=102 "The package “my-super-app.pkg” is untrusted." UserInfo={NSLocalizedDescription=The package “my-super-app.pkg” is untrusted., NSURL=file://localhost/Users/devops/.Trash/my-super-app.pkg#superapp.pkg, PKInstallPackageIdentifier=org.superapp.1.0.0, NSUnderlyingError=0x12921c350 {Error Domain=NSOSStatusErrorDomain Code=-2147409622 "CSSMERR_TP_NOT_TRUSTED" UserInfo={SecTrustResult=5, PKTrustLevel=PKTrustLevelNotTrusted, NSLocalizedFailureReason=CSSMERR_TP_NOT_TRUSTED}}} {
	    NSLocalizedDescription = "The package \U201cmy-super-app.pkg\U201d is untrusted.";
	    NSURL = "file://localhost/Users/devops/.Trash/my-super-app.pkg#superapp.pkg";
	    NSUnderlyingError = "Error Domain=NSOSStatusErrorDomain Code=-2147409622 \"CSSMERR_TP_NOT_TRUSTED\" UserInfo={SecTrustResult=5, PKTrustLevel=PKTrustLevelNotTrusted, NSLocalizedFailureReason=CSSMERR_TP_NOT_TRUSTED}";
	    PKInstallPackageIdentifier = "org.superapp.1.0.0";
	}

Pertama verifikasi apakah file PKG tersebut sudah di-sign

pkgutil --check-signature my-super-app-1.0.0.pkg

Application signed by trusted deveoper
bila dilihat dari output diatas, berarti sudah di-sign dengan benar, tetapi proses instalasi masih gagal.

devops-mac-thailand-farm ~ % sudo installer -pkg my-super-app-1.0.0.pkg -target /
installer: Package name is my-super-app
installer: Certificate used to sign package is not trusted. Use -allowUntrusted to override.

Solusi

System Keychain Mac

Download certificate dari https://www.apple.com/certificateauthority/

# Apple root CA
https://www.apple.com/appleca/AppleIncRootCertificate.cer
https://www.apple.com/certificateauthority/AppleComputerRootCertificate.cer
https://www.apple.com/certificateauthority/AppleRootCA-G2.cer
https://www.apple.com/certificateauthority/AppleRootCA-G3.cer
# Apple Intermediate Certificates
https://www.apple.com/certificateauthority/DeveloperIDCA.cer
https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer
https://www.apple.com/certificateauthority/AppleWWDRCAG2.cer
https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
https://www.apple.com/certificateauthority/AppleWWDRCAG4.cer
https://www.apple.com/certificateauthority/AppleWWDRCAG5.cer
https://www.apple.com/certificateauthority/AppleWWDRCAG6.cer

Buka Keychains, unlock System lalu import certificate diatas kedalam System Keychain

Solusi ini bisa dijalankan bila anda mendapati pesan signed by a certificate that has since expired

devops-mac-thailand-farm ~ % pkgutil --check-signature my-super-app-1.0.0.pkg
Package "my-super-app-1.0.0.pkg":
   Status: signed by a certificate that has since expired
   Signed with a trusted timestamp on: 2023-01-22 07:17:18 +0000
   Certificate Chain:
    1. Developer ID Installer: XXXXXX (XXXXXX)
       Expires: 2026-01-11 10:58:00 +0000
       SHA256 Fingerprint:
           12 4C E1 B1 18 5B 13 51 0B 5C 50 19 45 55 C8 3E 90 BF I4 0D C4 1F
           12 4B 75 41 2F 1C C6 F0 8A 51

Terakhir pastikan “Apple Store and identified developer” dicentang di Allow application downloaded from, yang bisa dilihat pada dari System Settings -> Privacy and Security
macOS Privacy and Settings

Coba install kembali aplikasi tersebut baik melalu GUI ataupun dari terminal

Leave a comment

Your email address will not be published. Required fields are marked *