<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/sec_protocol_options_set_peer_authentication_optional",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@sec_protocol_options_set_peer_authentication_optional"
  },
  "title" : "sec_protocol_options_set_peer_authentication_optional"
}
-->

# sec_protocol_options_set_peer_authentication_optional

```
void sec_protocol_options_set_peer_authentication_optional(sec_protocol_options_t options, bool peer_authentication_optional);
```

## Parameters

`options`

A `sec_protocol_options_t` instance.

`peer_authentication_optional`

Flag to enable or disable requested peer authentication.

## Discussion

\abstract When this is enabled, the endpoint requests the peer certificate, but if none is provided, the
endpoint still proceeds with the connection. Default false for servers; always false for clients (clients ignore
this option). If peer_authentication_required is set to true via
sec_protocol_options_set_peer_authentication_required(), peer_authentication_optional will be disregarded
and the peer certificate will be required.

---

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)