<!--
{
  "availability" : [
    "macOS: 10.2.0 - 10.9.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SSLSetAllowsExpiredRoots",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SSLSetAllowsExpiredRoots"
  },
  "title" : "SSLSetAllowsExpiredRoots"
}
-->

# SSLSetAllowsExpiredRoots

Specifies whether expired root certificates are allowed.

```
OSStatus SSLSetAllowsExpiredRoots(SSLContextRef context, Boolean allowsExpired);
```

## Parameters

`context`

An SSL session context reference.

`allowsExpired`

A Boolean value indicating whether to allow expired root certificates. Pass `true` to allow expired roots.

## Return Value

A result code. See [Secure Transport Result Codes](/documentation/Security/secure-transport-result-codes).

## Discussion

The default value for the `allowsExpired` flag is `false`. When this flag is `false`, Secure Transport returns an `errSSLCertExpired` result code during handshake if the root certificate is expired.

You can use the [`SSLGetAllowsExpiredRoots`](/documentation/Security/SSLGetAllowsExpiredRoots) function to determine the current setting of the `allowsExpired` flag.

Use the [`SSLSetAllowsExpiredCerts`](/documentation/Security/SSLSetAllowsExpiredCerts) function to set a value that determines whether expired non-root certificates are allowed.

---

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)