SSLSetProtocolVersionEnabled
Sets the allowed Secure Sockets Layer (SSL) protocol versions.
Declaration
OSStatus SSLSetProtocolVersionEnabled(SSLContextRef context, SSLProtocol protocol, Boolean enable);Parameters
- context:
An SSL session context reference.
- protocol:
The SSL protocol version to enable. Pass
kSSLProtocolAllto enable all protocols. - enable:
A Boolean value indicating whether to enable or disable the specified protocol. Specify
trueto enable the protocol.
Return Value
A result code. See Secure Transport Result Codes.
Discussion
Calling this function is optional. The default is that all supported protocols are enabled. When you call this function, only the specified protocol is affected. Therefore, if you call it once to disable SSL version 2 (for example), the other protocols all remain enabled. You may call this function as many times as you wish to enable and disable specific protocols. You can specify one of the following values for the protocol parameter:
kSSLProtocol2kSSLProtocol3kTLSProtocol1kSSLProtocolAll
This function cannot be called when a session is active.