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

# SSLSetAllowsExpiredCerts

Specifies whether certificate expiration times are ignored.

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

## Parameters

`context`

An SSL session context reference.

`allowsExpired`

A Boolean flag representing whether the certificate expiration times are ignored. The default for this flag is `false`, meaning expired certificates result in an `errSSLCertExpired` result code.

## Return Value

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

## Discussion

You can use this function to allow the handshake to succeed even if one or more certificates in the certificate chain have expired. You can use the [`SSLGetAllowsExpiredCerts`](/documentation/Security/SSLGetAllowsExpiredCerts) function to determine the current setting of the `allowsExpired` flag.

Use the [`SSLSetAllowsExpiredRoots`](/documentation/Security/SSLSetAllowsExpiredRoots) function to set a flag specifying whether expired 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)