libressl-ERR_print_errors(3)

libressl-ERR_print_errors3

Print openssl error messages

Usage

Crypto Library (libcrypto, -lcrypto)

#include <openssl/err.h>

void

ERR_print_errors(BIO *bp);

void

ERR_print_errors_fp(FILE *fp);

void

ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u);

Overview

ERR_print_errors() is a convenience function that prints the error strings for all errors that OpenSSL has recorded to bp, thus emptying the error queue.

ERR_print_errors_fp() is the same, except that the output goes to a FILE.

ERR_print_errors_cb() is the same, except that the callback function, cb, is called for each error line with the string, length, and userdata u as the callback parameters.

The error strings have the following format:

[pid]:error:[error code]:[library name]:[function name]:[reason string]:
[file name]:[line]:[optional text message]

The error code is an 8-digit hexadecimal number. The library name, the function name, and the reason string are ASCII text, as is the optional text message if one was set for the respective error code.

If there is no text string registered for the given error code, the error string will contain the numeric code.

History

ERR_print_errors() first appeared in SSLeay 0.4.5. ERR_print_errors_fp() first appeared in SSLeay 0.6.0. Both functions have been available since OpenBSD 2.4.

ERR_print_errors_cb() first appeared in OpenSSL 0.9.7 and has been available since OpenBSD 3.2.

From libressl 4.4.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's mdoc source.