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

# SSLGetPeerID(_:_:_:)

Retrieves the current peer ID data.

## Declaration

```swift
func SSLGetPeerID(_ context: SSLContext, _ peerID: UnsafeMutablePointer<UnsafeRawPointer?>, _ peerIDLen: UnsafeMutablePointer<Int>) -> OSStatus
```

## Parameters

- `context`: An SSL session context reference.
- `peerID`: On return, points to a buffer containing the peer ID data.
- `peerIDLen`: On return, the length of the peer ID data buffer.

## Return Value

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

## Discussion

Discussion If the peer ID data for this context was not set by calling the SSLSetPeerID(_:_:_:) function, this function returns a NULL pointer in the peerID parameter, and 0 in the peerIDLen parameter.
