1ERR_error_string(3) OpenSSL ERR_error_string(3)
2
3
4
6 ERR_error_string, ERR_error_string_n, ERR_lib_error_string,
7 ERR_func_error_string, ERR_reason_error_string - obtain human-readable
8 error message
9
11 #include <openssl/err.h>
12
13 char *ERR_error_string(unsigned long e, char *buf);
14 void ERR_error_string_n(unsigned long e, char *buf, size_t len);
15
16 const char *ERR_lib_error_string(unsigned long e);
17 const char *ERR_func_error_string(unsigned long e);
18 const char *ERR_reason_error_string(unsigned long e);
19
21 ERR_error_string() generates a human-readable string representing the
22 error code e, and places it at buf. buf must be at least 120 bytes
23 long. If buf is NULL, the error string is placed in a static buffer.
24 ERR_error_string_n() is a variant of ERR_error_string() that writes at
25 most len characters (including the terminating 0) and truncates the
26 string if necessary. For ERR_error_string_n(), buf may not be NULL.
27
28 The string will have the following format:
29
30 error:[error code]:[library name]:[function name]:[reason string]
31
32 error code is an 8 digit hexadecimal number, library name, function
33 name and reason string are ASCII text.
34
35 ERR_lib_error_string(), ERR_func_error_string() and
36 ERR_reason_error_string() return the library name, function name and
37 reason string respectively.
38
39 The OpenSSL error strings should be loaded by calling
40 ERR_load_crypto_strings(3) or, for SSL applications,
41 SSL_load_error_strings(3) first. If there is no text string registered
42 for the given error code, the error string will contain the numeric
43 code.
44
45 ERR_print_errors(3) can be used to print all error codes currently in
46 the queue.
47
49 ERR_error_string() returns a pointer to a static buffer containing the
50 string if buf == NULL, buf otherwise.
51
52 ERR_lib_error_string(), ERR_func_error_string() and
53 ERR_reason_error_string() return the strings, and NULL if none is
54 registered for the error code.
55
57 err(3), ERR_get_error(3), ERR_load_crypto_strings(3),
58 SSL_load_error_strings(3) ERR_print_errors(3)
59
61 ERR_error_string() is available in all versions of SSLeay and OpenSSL.
62 ERR_error_string_n() was added in OpenSSL 0.9.6.
63
64
65
661.0.2o 2020-08-01 ERR_error_string(3)