Specifies this connection’s certificate or certificates.
- iOS 5.0+
- macOS 10.2+
- tvOS 9.0+
- watchOS 2.0+
An SSL session context reference.
The certificates to set. This array contains items of type
Sec, except for
cert, which is of type
A result code. See Secure Transport Result Codes.
Setting the certificate or certificates is mandatory for server connections, but is optional for clients. Specifying a certificate for a client enables SSL client-side authentication. You must place in
Sec object that identifies the leaf certificate and its corresponding private key. Specifying a root certificate is optional; if it’s not specified, the root certificate that verifies the certificate chain specified here must be present in the system wide set of trusted anchor certificates.
This function must be called before calling
SSLHandshake, or immediately after
SSLHandshake has returned
err (that is, before the handshake is resumed by calling
Secure Transport assumes the following:
The certificate references remain valid for the lifetime of the session.
The identity specified in
certis capable of signing.
The required capabilities of the identity specified in
cert—and of the optional certificate specified in the
SSLSet function—are highly dependent on the application. For example, to work as a server with Netscape clients, the identity specified here must be capable of both signing and encrypting. Use the
SSLCopy function to get a list of certificates acceptable to the server.