SSL Controls

All SSL controls make use of the WSAIoctl function, with a set of dwIoControlCode values that are specific to SSL. The values for the dwIoControlCode are defined as follows:

/*
** This value is the SSL protocol tag and WSAIoctl dwIoControlCode
** "T" value.
*/
#define _SO_SSL                ((2L << 27) | (0x73L << 16))

/*
** These values are used to form the WSAIoctl dwIoControlCode
** "Code" value.
*/
#define _SO_SSL_FLAGS               0x01
#define _SO_SSL_CIPHERS             0x02
#define _SO_SSL_CLIENT              0x03
#define _SO_SSL_SERVER              0x04
#define _SO_SSL_AUTH_CERT_HOOK      0x08
#define _SO_SSL_RSA_ENCRYPT_HOOK    0x10
#define _SO_SSL_RSA_DECRYPT_HOOK    0x20

/*
** Actual SSL Ioctl commands
*/
#define SO_SSL_GET_FLAGS   (IOC_IN |_SO_SSL|_SO_SSL_FLAGS)
#define SO_SSL_SET_FLAGS   (IOC_OUT|_SO_SSL|_SO_SSL_FLAGS)
#define SO_SSL_GET_CIPHERS (IOC_IN |_SO_SSL|_SO_SSL_CIPHERS)
#define SO_SSL_SET_CIPHERS (IOC_OUT|_SO_SSL|_SO_SSL_CIPHERS)
#define SO_SSL_GET_CLIENT  (IOC_IN |_SO_SSL|_SO_SSL_CLIENT)
#define SO_SSL_SET_CLIENT  (IOC_OUT|_SO_SSL|_SO_SSL_CLIENT)
#define SO_SSL_GET_SERVER  (IOC_IN |_SO_SSL|_SO_SSL_SERVER)
#define SO_SSL_SET_SERVER  (IOC_OUT|_SO_SSL|_SO_SSL_SERVER)
#define SO_SSL_GET_AUTH_CERT_HOOK 
    (IOC_IN |_SO_SSL|_SO_SSL_AUTH_CERT_HOOK)
#define SO_SSL_SET_AUTH_CERT_HOOK        (IOC_OUT|_SO_SSL|_SO_SSL_AUTH_CERT_HOOK)
#define SO_SSL_GET_RSA_ENCRYPT_HOOK  
    (IOC_IN |_SO_SSL|_SO_SSL_RSA_ENCRYPT_HOOK)
#define SO_SSL_SET_RSA_ENCRYPT_HOOK      (IOC_OUT|_SO_SSL|_SO_SSL_RSA_ENCRYPT_HOOK)
#define SO_SSL_GET_RSA_DECRYPT_HOOK  
    (IOC_IN |_SO_SSL|_SO_SSL_RSA_DECRYPT_HOOK)
#define SO_SSL_SET_RSA_DECRYPT_HOOK      (IOC_OUT|_SO_SSL|_SO_SSL_RSA_DECRYPT_HOOK)