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

# SSLGetNegotiatedCipher(_:_:)

Retrieves the cipher suite negotiated for this session.

## Declaration

```swift
func SSLGetNegotiatedCipher(_ context: SSLContext, _ cipherSuite: UnsafeMutablePointer<SSLCipherSuite>) -> OSStatus
```

## Parameters

- `context`: An SSL session context reference.
- `cipherSuite`: On return, points to the cipher suite that was negotiated for this session.

## Return Value

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

## Discussion

Discussion You should call this function only when a session is active.
