<!--
{
  "availability" : [
    "macOS: 10.2.0 - 10.9.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SSLNewContext",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SSLNewContext"
  },
  "title" : "SSLNewContext"
}
-->

# SSLNewContext

Creates a new Secure Sockets Layer (SSL) session context.

```
OSStatus SSLNewContext(Boolean isServer, SSLContextRef*contextPtr);
```

## Parameters

`isServer`

Set `true` if the calling process is a server.

`contextPtr`

On return, points to a new SSL session context reference.

## Return Value

A result code. See [Secure Transport Result Codes](/documentation/Security/secure-transport-result-codes).

## Discussion

The SSL session context is an opaque data structure that identifies a session and stores session information. You must pass this object to every other function in the Secure Transport API.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)