---
title: "sec_protocol_metadata_copy_negotiated_protocol(_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sec_protocol_metadata_copy_negotiated_protocol(_:)"
---

# sec_protocol_metadata_copy_negotiated_protocol(_:)

## Declaration

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

## Parameters

- `metadata`: A sec_protocol_metadata_t instance.

## Return Value

Return Value A NULL-terminated string carrying the negotiated protocol.

## Discussion

Discussion 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.
