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

# SSLSetEnableCertVerify

Enables or disables peer certificate chain validation.

```
OSStatus SSLSetEnableCertVerify(SSLContextRef context, Boolean enableVerify);
```

## Parameters

`context`

An SSL session context reference.

`enableVerify`

A Boolean value specifying whether peer certificate chain validation is enabled. Certificate chain validation is enabled by default. Specify `false` to disable validation.

## Return Value

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

## Discussion

By default, Secure Transport attempts to verify the certificate chain during an exchange of peer certificates. If you disable peer certificate chain validation, it is your responsibility to call [`SSLCopyPeerCertificates`](/documentation/Security/SSLCopyPeerCertificates) upon successful completion of the handshake and then to validate the peer certificate chain before transferring the data.

You can use the [`SSLGetEnableCertVerify`](/documentation/Security/SSLGetEnableCertVerify) function to determine the current setting of the `enableVerify` 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)