---
title: "SSLSetProtocolVersionMax(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sslsetprotocolversionmax(_:_:)"
---

# SSLSetProtocolVersionMax(_:_:)

Sets the maximum protocol version allowed by the application for a given SSL context.

## Declaration

```swift
func SSLSetProtocolVersionMax(_ context: SSLContext, _ maxVersion: SSLProtocol) -> OSStatus
```

## Parameters

- `context`: The SSL context associated with the connection.
- `maxVersion`: The new maximum version (doc://com.apple.security/documentation/Security/SSLProtocol/tlsProtocol1, for example). See doc://com.apple.security/documentation/Security/SSLProtocol for a complete list.

## Return Value

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