<!--
{
  "availability" : [
    "macOS: 10.5.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SSLSetCertificateAuthorities(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SSLSetCertificateAuthorities"
  },
  "title" : "SSLSetCertificateAuthorities(_:_:_:)"
}
-->

# SSLSetCertificateAuthorities(_:_:_:)

Adds one or more certificates to a server’s list of certification authorities (CAs) acceptable for client authentication.

```
func SSLSetCertificateAuthorities(_ context: SSLContext, _ certificateOrArray: CFTypeRef, _ replaceExisting: Bool) -> OSStatus
```

## Parameters

`context`

An SSL session context reference.

`certificateOrArray`

A value of type `SecCertificateRef`, or a value of type `CFArray` containing an array of `SecCertificateRef` values, representing one or more certificates to be added to the server’s list of acceptable certification authorities (CAs).

`replaceExisting`

A Boolean value specifying whether to replace or append the current set of certification authorities. If this value is `true`, the specified certificates replace the existing list of acceptable CAs, if any. If `false`, the specified certificates are appended to the existing list of.

## Return Value

A result code. See [Secure Transport Result Codes](/documentation/Security/secure-transport-result-codes). Returns [`errSecParam`](/documentation/Security/errSecParam) if this function is called for a session that is configured as a client, or when a session is active.

## Discussion

Each successive call to this function with the `replaceExisting` parameter set to <doc://com.apple.documentation/documentation/Swift/false> results in accumulation of additional certification authorities. To see the current set of certification authorities, call the [`SSLCopyCertificateAuthorities(_:_:)`](/documentation/Security/SSLCopyCertificateAuthorities(_:_:)) function.

## See Also

[`SSLCopyDistinguishedNames`](/documentation/Security/SSLCopyDistinguishedNames(_:_:))

Retrieves the distinguished names of acceptable certification authorities.



---

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)