ERR_PRINT_ERRORS(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… ERR_PRINT_ERRORS(3ossl) β€” the OpenSSL error-printing girlies

okay so bestie, welcome to the 3ossl corner of the manual, where we learn how to actually see the errors OpenSSL has been quietly hoarding. this one's short and sweet and honestly kind of iconic πŸ’–


✨ NAME ✨

ERR_print_errors, ERR_print_errors_fp, ERR_print_errors_cb β€” the print-error-messages squad 🫢


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

like, copy it exactly, no cap πŸŽ€


✨ DESCRIPTION ✨

so ERR_print_errors() is THE convenience function. it prints the error strings for all the errors OpenSSL has recorded, straight into bp β€” and the way it does that is by emptying the error queue. yes bestie, it eats them. gone. that's the whole vibe check πŸ”₯

ERR_print_errors_fp() is literally the same thing, except the output goes to a FILE instead. simple as that, no drama 🌸

ERR_print_errors_cb() is also the same, except the callback function cb gets called for each error line, and it receives the string, the length, and the userdata u as its callback parameters. very "custom handler main character energy" of it πŸ’…


πŸ¦‹ the format, bestie

the error strings come out looking like this, and yes it's long, we love a thorough queen:

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

quick breakdown of the cast πŸ’œ:

  • error code is an 8 digit hexadecimal number ✨
  • library name, function name and reason string are ASCII text
  • optional text message is ASCII text too, if one was actually set for that respective error code πŸ™ˆ
and if there's no text string registered for the given error code? ngl, the error string just contains the numeric code instead. it's giving "no thoughts, just digits" πŸ’€

✨ RETURN VALUES ✨

ERR_print_errors() and ERR_print_errors_fp() return no values. like, nothing. void. they simply show up, do the printing, and leave πŸ‘‘ (no info on the callback one here, that's just how the page is, i don't make the rules πŸŽ€)


✨ SEE ALSO ✨

go read these next, bestie, they're lowkey essential:


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, mwah πŸ’‹ this was version 3.5.6, dated 2026-04-07 β€” write it down, cite it, put it on your vision board, and stan responsibly πŸŒˆβ­πŸ’–

πŸ“¦ where this page comes from