ERR_PRINT_ERRORS(3SSL)

πŸ’– ERR_PRINT_ERRORS πŸ’–

okay bestie, gather round, because this is literally the manual page for ERR_print_errors, ERR_print_errors_fp, and ERR_print_errors_cb β€” the little trio in the OpenSSL library (3SSL) that spills all your error tea. ✨


🌸 NAME 🌸

ERR_print_errors, ERR_print_errors_fp, ERR_print_errors_cb β€” print error messages, bestie. that's it. that's the whole job. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#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);

✨ DESCRIPTION ✨

so ERR_print_errors() is the convenience queen πŸ‘‘ β€” she prints the error strings for all the errors that OpenSSL has recorded, straight to bp, and in doing so she empties the error queue. like, drains it. nothing left. gone. πŸ’€

ERR_print_errors_fp() is the exact same vibe, except the output goes to a FILE. same energy, different destination. 🫢

ERR_print_errors_cb() is also the same, except that the callback function cb gets called once for each error line, and it receives the string, the length, and the userdata u as its callback parameters. so you get to handle each line yourself. main character callback energy, honestly. 🌈

the error strings come out in this exact format:

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

okay let's break it down because the details matter, no cap:

  • error code is an 8 digit hexadecimal number.
  • library name, function name, and reason string are ASCII text.
  • optional text message is also ASCII text β€” if one was set for the respective error code. if not, it's just not there, and that's fine. πŸ™ˆ
heads up bestie: if there is no text string registered for the given error code, the error string will just contain the numeric code. so don't be confused when you see numbers staring back at you. πŸ’€

πŸ’œ RETURN VALUES πŸ’œ

ERR_print_errors() and ERR_print_errors_fp() return no values. nope. nothing. they just do the thing and dip. 😌

(and yeah, notice ERR_print_errors_cb() isn't in that list β€” the original page only names those two here, so that's exactly what we're saying. 🀷)


πŸ¦‹ SEE ALSO πŸ¦‹

iykyk, go read those next. obsessed with a linked manpage moment. πŸ“šβœ¨


Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. πŸ’–

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page, bestie!! πŸŽ€ this was OpenSSL 4.0.3, dated 2026-09-29, and yeah β€” it's giving iconic documentation. slay. periodt. πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from