5 ERR_error_string - obtain human-readable error message
9 #include <openssl/err.h>
11 char *ERR_error_string(unsigned long e, char *buf);
13 const char *ERR_lib_error_string(unsigned long e);
14 const char *ERR_func_error_string(unsigned long e);
15 const char *ERR_reason_error_string(unsigned long e);
19 ERR_error_string() generates a human-readable string representing the
20 error code B<e>, and places it at B<buf>. B<buf> must be at least 120
21 bytes long. If B<buf> is B<NULL>, the error string is placed in a
24 The string will have the following format:
26 error:[error code]:[library name]:[function name]:[reason string]
28 I<error code> is an 8 digit hexadecimal number, I<library name>,
29 I<function name> and I<reason string> are ASCII text.
31 ERR_lib_error_string(), ERR_func_error_string() and
32 ERR_reason_error_string() return the library name, function
33 name and reason string respectively.
35 The OpenSSL error strings should be loaded by calling
36 L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)> or, for SSL
37 applications, L<SSL_load_error_strings(3)|SSL_load_error_strings(3)>
39 If there is no text string registered for the given error code,
40 the error string will contain the numeric code.
42 L<ERR_print_errors(3)|ERR_print_errors(3)> can be used to print
43 all error codes currently in the queue.
47 ERR_error_string() returns a pointer to a static buffer containing the
48 string if B<buf == NULL>, B<buf> otherwise.
50 ERR_lib_error_string(), ERR_func_error_string() and
51 ERR_reason_error_string() return the strings, and B<NULL> if
52 none is registered for the error code.
56 L<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>,
57 L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)>,
58 L<SSL_load_error_strings(3)|SSL_load_error_strings(3)>
59 L<ERR_print_errors(3)|ERR_print_errors(3)>
63 ERR_error_string() is available in all versions of SSLeay and OpenSSL.