---
title: "setTrustedServerCertificates(_:)"
framework: networkextension
role: symbol
role_heading: Instance Method
path: "networkextension/nehotspoteapsettings/settrustedservercertificates(_:)"
---

# setTrustedServerCertificates(_:)

Sets trusted EAP server certificates for an enterprise Wi-Fi or Hotspot 2.0 network.

## Declaration

```swift
func setTrustedServerCertificates(_ certificates: [Any]) -> Bool
```

## Parameters

- `certificates`: An array of doc://com.apple.documentation/documentation/Security/SecCertificate objects. The EAP peer uses these certificates to evaluate the trust of the server certificate chain.

## Return Value

Return Value Returns false if any element in the array is not an object of type SecCertificate or if the OS fails to find a persistent reference for each element from the application’s keychain; else return true.

## Discussion

Discussion Your app must store the certificates in keychain access group $(TeamIdentifierPrefix)com.apple.networkextensionsharing. The OS uses SecItemCopyMatching(_:_:) to obtain a persistent reference to each certificate from the application’s keychain and uses it during EAP authentication. The number of elements in the certificate array may not be more than 10.

## See Also

### Setting Keychain-based EAP Properties

- [setIdentity(_:)](networkextension/nehotspoteapsettings/setidentity(_:).md)
