SO_SSL_GET_CIPHERS/SO_SSL_SET_CIPHERS

This WSAIoctl command is used to get/set the privacy ciphers that SSL should attempt to use for the socket. The lpvInBuffer points to the following structure:

struct sslcipheropts {
    int n;
    char specs[3];         /* 3 bytes per n */
};
 

The value n specifies the number of ciphers (not the number of bytes of ciphers) and specs is an array of 3 byte values that contain the cipher specs. When SO_SSL_GET_CIPHERS is used, the structure is filled in with the ciphers that are supported by the socket. If WSAIoctl with SO_SSL_GET_CIPHERS is called before any changes are made to the socket via SO_SSL_SET_CIPHERS then the value returned will represent the underlying implementations abilities. If SO_SSL_SET_CIPHERS is used then the values are used as a replacement for the built in ciphers for the given socket.

For SO_SSL_SET_CIPHERS, the error EINVAL will be returned if a cipher is specified that is not supported by the implementation. The legal values for the ciphers specs are defined in the SSL specification document.