You can call the mysql_get_ssl_cipher() function to return the encryption password used for the specified server connection.
Syntax
const char *
mysql_get_ssl_cipher(MYSQL *mysql)
mysql is the connection handler returned from mysql_init().
Return values
A string naming the encryption password used for the connection is returned. NULL is returned if the connection is not encrypted.
Errors
None.