Instance Method


Override the default trust evaluation for the connection


- (void)evaluateTrustForConnection:(NWTCPConnection *)connection peerCertificateChain:(NSArray<id> *)peerCertificateChain completionHandler:(void (^)(SecTrustRef trust))completion;



The connection sending this message


The connection peer’s certificate chain


The completion handler for passing the SecTrustRef object to the connection. The SecTrustRef object trust is required and must not be nil. It will be evaluated using SecTrustEvaluate if necessary.

The caller is responsible for keeping the argument object valid for the duration of the completion handler invocation.


The caller can implement this optional protocol method to set up custom policies for peer certificate trust evaluation. If the delegate method is implemented, the caller is responsible for creating and setting up the SecTrustRef object and passing it to the completion handler. Otherwise, the default trust evaluation policy is used for the connection.

See Also

Delegate Methods

- shouldEvaluateTrustForConnection:

Indicate that the delegate should override the default trust evaluation for the connection

- shouldProvideIdentityForConnection:

Indicate that the delegate can provide an identity for the connection authentication

- provideIdentityForConnection:completionHandler:

Provide the identity and an optional certificate chain to be used for authentication

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software