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

# SSLCopyRequestedPeerNameLength(_:_:)

Obtains the hostname specified by the client in the ServerName extension (SNI). Server only.

## Declaration

```swift
func SSLCopyRequestedPeerNameLength(_ ctx: SSLContext, _ peerNameLen: UnsafeMutablePointer<Int>) -> OSStatus
```

## Parameters

- `ctx`: An SSL session context reference.
- `peerNameLen`: The length of the peer name, as retrieved by calling the doc://com.apple.security/documentation/Security/SSLCopyRequestedPeerName(_:_:_:) function.

## Return Value

Return Value A result code. See Secure Transport Result Codes.
