<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecPolicyCreateSSL(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecPolicyCreateSSL"
  },
  "title" : "SecPolicyCreateSSL(_:_:)"
}
-->

# SecPolicyCreateSSL(_:_:)

Returns a policy object for evaluating SSL certificate chains.

```
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.

## Return Value

The policy object. In Objective-C, call the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> function to release the object when you are finished with it.

## Discussion

---

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)