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

# sec_protocol_metadata_copy_negotiated_protocol(_:)

```
func sec_protocol_metadata_copy_negotiated_protocol(_ metadata: sec_protocol_metadata_t) -> UnsafePointer<CChar>?
```

## Parameters

`metadata`

A `sec_protocol_metadata_t` instance.

## Return Value

A NULL-terminated string carrying the negotiated protocol.

## Discussion

\abstract Copy the application protocol negotiated, e.g., via the TLS ALPN extension.
The caller is expected to `free` the output string when no longer needed.

---

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)