Trying to apply 'always trust' to certificate added to keychain using both SecItemAdd()
and SecPKCS12Import()
with SecTrustSettingsSetTrustSettings().
I created a launchdaemon for this purpose.
AuthorizationDB is modified so that any process running in root can apply trust to certificate.
let option = SecTrustSettingsResult.trustRoot.rawValue
// SecTrustSettingsResult.trustAsRoot.rawValue for non-root certificates
let status = SecTrustSettingsSetTrustSettings(secCertificate, SecTrustSettingsDomain.admin, [kSecTrustSettingsResult: NSNumber(value: option.rawValue)] as CFTypeRef).
Above code is used to trust certificates and it was working on os upto 14.7.4.
In 14.7.5 SecTrustSettingsSetTrustSettings()
returns errAuthorizationInteractionNotAllowed.
In 15.5 modifying authorization db with AuthorizationRightSet()
itself is returning errAuthorizationDenied.
Tried manually editing authorization db via terminal and same error occurred.
Did apple update anything on Security framework?
Any other way to trust certificates?
See this thread.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"