> From: owner-openssl-us...@openssl.org On Behalf Of ikuzar > Sent: Friday, 25 February, 2011 09:57
> 2011/2/25 lzyzizi <lzyz...@126.com> > You can use ERR_GET_FUNC(l) with the error code to get > the error function ID that is defined in the module's header(here is ssl.h). > You can also use const char *ERR_func_error_string(unsigned long e) > with the error code to get the string representation of the error function. That's just the function-name which is rarely sufficient. While you can fiddle the pieces yourself, ERR_error_string[_n](e,buf[,n]) gives you everything in one lump which is usually more convenient. Or just printf %lx, and lookup manually with commandline 'errstr'. > Every time you want to know the string information of the error code, > you need to call the void ERR_load_ERR_strings(void) first. > (or call ERR_load_(MODULE NAM)_strings(void) such as void ERR_load_SSL_strings(void)) Not 'every time'. You need to load error strings sometime before you use them, but it's common to do it once at startup. ERR_load_ERR_strings only loads some internal infrastructure stuff, which is nowhere near enough. If you want you can do each relevant module individually ERR_load_RSA_strings ERR_load_BN_strings ERR_load_SSL_strings etc., but it's almost always easier to just do SSL_load_error_strings which does everything. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org