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

# SSLGetAllowsExpiredCerts

Retrieves the value specifying whether expired certificates are allowed.

```
OSStatus SSLGetAllowsExpiredCerts(SSLContextRef context, Boolean *allowsExpired);
```

## Parameters

`context`

An SSL session context reference.

`allowsExpired`

On return, this flag is set to the value of the Boolean flag that specifies whether expired certificates are ignored. If this value is `true`, then Secure Transport does not return an error if any certificates in the certificate chain are expired.

## Return Value

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

## Discussion

You can set the `allowsExpired` flag to allow the handshake to succeed even if one or more certificates in the certificate chain have expired. This function returns the current setting of this flag. Use the [`SSLSetAllowsExpiredCerts`](/documentation/Security/SSLSetAllowsExpiredCerts) function to set the value of the `allowsExpired` flag.

---

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)