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

# SSLGetPeerDomainName(_:_:_:)

Retrieves the peer domain name specified previously.

## Declaration

```swift
func SSLGetPeerDomainName(_ context: SSLContext, _ peerName: UnsafeMutablePointer<CChar>, _ peerNameLen: UnsafeMutablePointer<Int>) -> OSStatus
```

## Parameters

- `context`: An SSL session context reference.
- `peerName`: On return, points to the peer domain name.
- `peerNameLen`: A pointer to the length of the peer domain name. Before calling this function, retrieve the peer domain name length by calling the function doc://com.apple.security/documentation/Security/SSLGetPeerDomainNameLength(_:_:).

## Return Value

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

## Discussion

Discussion If you previously called the SSLSetPeerDomainName(_:_:_:) function to specify a fully qualified domain name for the peer certificate, you can use the SSLGetPeerDomainName(_:_:_:) function to retrieve the domain name.
