---
title: "SSLCreateContext(_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sslcreatecontext(_:_:_:)"
---

# SSLCreateContext(_:_:_:)

Allocates and returns a new context.

## Declaration

```swift
func SSLCreateContext(_ alloc: CFAllocator?, _ protocolSide: SSLProtocolSide, _ connectionType: SSLConnectionType) -> SSLContext?
```

## Parameters

- `alloc`: The allocator to use. Pass NULL or doc://com.apple.documentation/documentation/CoreFoundation/kCFAllocatorDefault to use the default allocator.
- `protocolSide`: Either doc://com.apple.security/documentation/Security/SSLProtocolSide/serverSide or doc://com.apple.security/documentation/Security/SSLProtocolSide/clientSide.
- `connectionType`: Either doc://com.apple.security/documentation/Security/SSLConnectionType/streamType or doc://com.apple.security/documentation/Security/SSLConnectionType/datagramType.

## Mentioned in

Using the Secure Socket Layer for Network Communication

## Return Value

Return Value A new context. In Objective-C, use CFRelease to release this object’s memory when you are done with it.
