<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEHotspotEAPSettings/setTrustedServerCertificates(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEHotspotEAPSettings(im)setTrustedServerCertificates:"
  },
  "title" : "setTrustedServerCertificates(_:)"
}
-->

# setTrustedServerCertificates(_:)

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

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

Returns <doc://com.apple.documentation/documentation/Swift/false> if any element in the array is not an object of type <doc://com.apple.documentation/documentation/Security/SecCertificate> or if the OS fails to find a persistent reference for each element from the application’s keychain; else return <doc://com.apple.documentation/documentation/Swift/true>.

## Discussion

Your app must store the certificates in keychain access group `$(TeamIdentifierPrefix)com.apple.networkextensionsharing`. The OS uses <doc://com.apple.documentation/documentation/Security/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.

---

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)