ERR_ERROR_STRING(3ossl)
π ERR_ERROR_STRING(3ossl) π
hey bestie!! so you've summoned the 3ossl manual page for the error-string girlies, and honestly? you came to the right place. this whole family of functions is about turning that cursed little number you got back into actual words a human can read. let's go π
β¨ NAME β¨
ERR_error_string, ERR_error_string_n, ERR_lib_error_string, ERR_func_error_string, ERR_reason_error_string β obtain human-readable error message. that's the whole vibe: number goes in, words come out, you stop crying π
π SYNOPSIS π
#include <openssl/err.h>
char *ERR_error_string(unsigned long e, char *buf);
void ERR_error_string_n(unsigned long e, char *buf, size_t len);
const char *ERR_lib_error_string(unsigned long e);
const char *ERR_reason_error_string(unsigned long e);
and now, the deprecated one β deprecated in OpenSSL 3.0, so likeβ¦ she's still here but she's not thriving:
const char *ERR_func_error_string(unsigned long e);
π¦ DESCRIPTION π¦
okay so first up, ERR_error_string() generates a human-readable string representing the error code e, and places it at buf. and listen β buf must be at least 256 bytes long. not 200, not "eh probably fine". 256. π«Ά
if buf is NULL, the error string goes into a static buffer instead. but heads up, bestie: this function is not thread-safe and it does no checks on the size of the buffer. no vibe check at all, she just writes. so please, use ERR_error_string_n() instead. π
ERR_error_string_n() is the variant of ERR_error_string() that writes at most len characters (including the terminating 0) and truncates the string if necessary. and for ERR_error_string_n(), buf MUST NOT be NULL. like, at all. non-negotiable π
the string will have this format, and yes it has that empty :: in the middle, that's not a typo, that's just her π§
error:[error code]:[library name]::[reason string]
where error code is an 8 digit hexadecimal number, and library name and reason string are ASCII text. iconic little trio.
ERR_lib_error_string() and ERR_reason_error_string() return the library name and reason string respectively. feeling efficient today.
if there is no text string registered for the given error code, the error string will contain the numeric code. no name, no reason, just numbers β she's giving mystery π₯
also!! ERR_print_errors(3) can be used to print all error codes currently in the queue. very handy, very main character energy.
β RETURN VALUES β
ERR_error_string()returns a pointer to a static buffer containing the string ifbuf == NULL, andbufotherwise. yep, exactly like that πERR_lib_error_string()andERR_reason_error_string()return the strings, andNULLif none is registered for the error code.ERR_func_error_string()returnsNULL. that's it. that's the whole return value. she's retired π
πΈ SEE ALSO πΈ
go read those next, iykyk π
π HISTORY π
ERR_func_error_string() became deprecated in OpenSSL 3.0. she had a good run π
π COPYRIGHT π
Copyright 2000-2017 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>.
okay that's the whole page bestie, no cap, every detail intact π this was version 3.5.6, dated 2026-04-07, and you've been reading ERR_ERROR_STRING(3ossl) β slay, go fix that error code, you've got this π«Άβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms