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

# SSLCopyDistinguishedNames(_:_:)

Retrieves the distinguished names of acceptable certification authorities.

```
func SSLCopyDistinguishedNames(_ context: SSLContext, _ names: UnsafeMutablePointer<CFArray?>) -> OSStatus
```

## Parameters

`context`

An SSL session context reference.

`names`

On return, an array of `CFDataRef` objects, each representing one DER-encoded relative distinguished name of an acceptable certification authority. You must call the `CFRelease` function to release this array when you are finished with it.

## Return Value

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

## Discussion

The list of distinguished names is provided by the server if the context reference represents a client; if the context reference represents a server, the list of distinguished names is specified with the [`SSLSetCertificateAuthorities(_:_:_:)`](/documentation/Security/SSLSetCertificateAuthorities(_:_:_:)) function.

The array retrieved by this function is suitable for use in finding a client identity (that is, a certificate and associated private key) that matches a server’s requirements.

## See Also

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

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

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

Retrieves the current list of 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)