SSLSetPeerDomainName(_:_:_:)
Specifies the fully qualified domain name of the peer.
Declaration
func SSLSetPeerDomainName(_ context: SSLContext, _ peerName: UnsafePointer<CChar>?, _ peerNameLen: Int) -> OSStatusParameters
- 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 thatNULLtermination is optional. - peerNameLen:
The number of bytes passed in the
peerNameparameter.
Mentioned in
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.