---
title: "SecPolicyCreateSSL(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/secpolicycreatessl(_:_:)"
---

# SecPolicyCreateSSL(_:_:)

Returns a policy object for evaluating SSL certificate chains.

## Declaration

```swift
func SecPolicyCreateSSL(_ server: Bool, _ hostname: CFString?) -> SecPolicy
```

## Parameters

- `server`: Specify true on the client side to return a policy for SSL server certificates.
- `hostname`: If you specify a value for this parameter, the policy will require the specified value to match the host name in the leaf certificate.

## Mentioned in

Creating a Trust Object

## Return Value

Return Value The policy object. In Objective-C, call the CFRelease function to release the object when you are finished with it.
