Specifies a restricted set of SSL cipher suites to be enabled by the current SSL session context.


func SSLSetEnabledCiphers(_ context: SSLContext, _ ciphers: UnsafePointer<SSLCipherSuite>, _ numCiphers: Int) -> OSStatus



An SSL session context reference.


A pointer to the cipher suites to enable.


The number of cipher suites to enable.

Return Value

A result code. See Secure Transport Result Codes.


You can call this function, for example, to limit cipher suites to those that use exportable key sizes or to those supported by a particular protocol version.

This function can be called only when no session is active. The default set of enabled cipher suites is the complete set of supported cipher suites obtained by calling the SSLGetSupportedCiphers(_:_:_:) function.

Call the SSLGetEnabledCiphers(_:_:_:) function to determine which SSL cipher suites are currently enabled.

See Also


func SSLGetNumberEnabledCiphers(SSLContext, UnsafeMutablePointer<Int>) -> OSStatus

Determines the number of cipher suites currently enabled.

func SSLSetDiffieHellmanParams(SSLContext, UnsafeRawPointer?, Int) -> OSStatus

Specifies Diffie-Hellman parameters for a given context.

typealias SSLCipherSuite

A type for storing cipher suite values.

enum SSLCiphersuiteGroup

A mechanism for grouping related cipher suites.

SSL Cipher Suite Values

Recognize the set of valid SSL cipher suite values.