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

# SSLGetConnection(_:_:)

Retrieves an I/O connection—such as a socket or endpoint—for a specific session.

## Declaration

```swift
func SSLGetConnection(_ context: SSLContext, _ connection: UnsafeMutablePointer<SSLConnectionRef?>) -> OSStatus
```

## Parameters

- `context`: An SSL session context reference.
- `connection`: On return, a pointer to a session connection reference. If no connection has been set using the doc://com.apple.security/documentation/Security/SSLSetConnection(_:_:) function, then this parameter is NULL on return.

## Return Value

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

## Discussion

Discussion You can use this function on either the client or server to retrieve the connection associated with a secure session.
