---
title: "SSLSetError(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sslseterror(_:_:)"
---

# SSLSetError(_:_:)

Sets the status of a session context.

## Declaration

```swift
func SSLSetError(_ context: SSLContext, _ status: OSStatus) -> OSStatus
```

## Parameters

- `context`: A session context.
- `status`: A status result for the context, not to be confused with the return result of this function call. See doc://com.apple.security/documentation/Security/secure-transport-result-codes.

## Return Value

Return Value A result code that represents the outcome of this function call, not to be confused with the status parameter. See Secure Transport Result Codes.

## Discussion

Discussion Call this function after handling the steps of an SSL handshake, such as server certificate validation.
