---
title: "SecTrustSetExceptions(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sectrustsetexceptions(_:_:)"
---

# SecTrustSetExceptions(_:_:)

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

## Declaration

```swift
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 doc://com.apple.security/documentation/Security/SecTrustCopyExceptions(_:).

## Return Value

Return Value A Boolean that is true if the exceptions cookies was valid and matches the current leaf certificate, false otherwise.

## Discussion

Discussion important: Even if this function returns true, you must still call SecTrustEvaluateWithError(_:_:) because the evaluation can still fail if something changes between the initial evaluation and the reevaluation.
