<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecTrustSetExceptions(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecTrustSetExceptions"
  },
  "title" : "SecTrustSetExceptions(_:_:)"
}
-->

# SecTrustSetExceptions(_:_:)

Sets a list of exceptions that should be ignored when the certificate is evaluated.

```
func SecTrustSetExceptions(_ trust: SecTrust, _ exceptions: CFData?) -> Bool
```

## Parameters

`trust`

The trust management object whose exception list you wish to modify.

`exceptions`

An opaque cookie returned by a prior call to [`SecTrustCopyExceptions(_:)`](/documentation/Security/SecTrustCopyExceptions(_:)).

## Return Value

A Boolean that is <doc://com.apple.documentation/documentation/Swift/true> if the exceptions cookies was valid and matches the current leaf certificate, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion> Important: Even if this function returns true, you must still call ``doc://com.apple.security/documentation/Security/SecTrustEvaluateWithError(_:_:)`` because the evaluation can still fail if something changes between the initial evaluation and the reevaluation.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)