Function

SSLSetPeerDomainName

Specifies the fully qualified domain name of the peer.

Declaration

OSStatus SSLSetPeerDomainName(SSLContextRef context, const char *peerName, size_t peerNameLen);

Parameters

context

An SSL session context reference.

peerName

The fully qualified domain name of the peer—for example, store.apple.com. The name is in the form of a C string, except that NULL termination is optional.

peerNameLen

The number of bytes passed in the peerName parameter.

Return Value

A result code. See Secure Transport Result Codes.

Discussion

You can use this function to verify the common name field in the peer’s certificate. If you call this function and the common name in the certificate does not match the value you specify in the peerName parameter, then handshake fails and returns errSSLXCertChainInvalid. Use of this function is optional.

This function can be called only when no session is active.

See Also

The Peer Domain Name

SSLGetPeerDomainNameLength

Determines the length of a previously set peer domain name.

Deprecated
SSLGetPeerDomainName

Retrieves the peer domain name specified previously.

Deprecated
SSLCopyRequestedPeerName

Determines the buffer size needed for the peer domain name.

Deprecated
SSLCopyRequestedPeerNameLength

Obtains the hostname specified by the client in the ServerName extension (SNI). Server only.

Deprecated