BIO(7ossl)
πΈ BIO(7ossl) β the OpenSSL manual, bestie edition πΈ
okay so you opened the BIO(7ossl) page from the OpenSSL manual and honestly? iconic choice. let's get into it π
β¨ NAME β¨
bio β Basic I/O abstraction. that's it, that's the whole name, and she ate π
β¨ SYNOPSIS β¨
#include <openssl/bio.h>
literally just include the header and you're in, no cap π«Ά
β¨ DESCRIPTION β¨
okay so a BIO is an I/O abstraction β think of it as a little vibe layer that hides a bunch of the underlying I/O details from your application π. and the way that this slaps is: if your app uses a BIO for its I/O, it can transparently handle SSL connections, unencrypted network connections, and file I/O. all of them. no drama. β¨
there are two types of BIO, bestie β a source/sink BIO and a filter BIO π
as the name implies, a source/sink BIO is a source and/or sink of data β examples include a socket BIO and a file BIO π§
a filter BIO takes data from one BIO and passes it through to another, or to the application. the data may be left unmodified (for example a message digest BIO) or translated (for example an encryption BIO) π. and the effect of a filter BIO may change according to the I/O operation it's performing: for example an encryption BIO will encrypt data if it's being written to and decrypt data if it's being read from. she's versatile like that π
BIOs can be joined together to form a chain (a single BIO is a chain with one component). a chain normally consists of one source/sink BIO and one or more filter BIOs π. data read from or written to the first BIO then traverses the chain to the end (normally a source/sink BIO). it's giving relay race, it's giving main character energy π¦
some BIOs (such as memory BIOs) can be used immediately after calling BIO_new(). others (such as file BIOs) need some additional initialization, and frequently a utility function exists to create and initialize such BIOs πββοΈ
β οΈ okay important warning time: if BIO_free() is called on a BIO chain it will only free one BIO, resulting in a memory leak π. do not do this to yourself. i'm begging.
calling BIO_free_all() on a single BIO has the same effect as calling BIO_free() on it β other than the discarded return value π
normally the type argument is supplied by a function which returns a pointer to a BIO_METHOD. there's a naming convention for such functions: a source/sink BIO typically starts with BIO_s_ and a filter BIO with BIO_f_ πΈ iykyk
π TCP Fast Open π
TCP Fast Open (RFC7413), abbreviated "TFO", is supported by the BIO interface since OpenSSL 3.2 π₯. TFO is supported in the following operating systems:
- Linux kernel 3.13 and later, where TFO is enabled by default.
- Linux kernel 4.11 and later, using
TCP_FASTOPEN_CONNECT. - FreeBSD 10.3 to 11.4, supports server TFO only.
- FreeBSD 12.0 and later, supports both client and server TFO.
- macOS 10.14 and later.
each operating system has a slightly different API for TFO π§ β please refer to the operating systems' API documentation when using sockets directly. like, actually read them, bestie, don't just vibe your way through π«Ά
β¨ EXAMPLES β¨
create a memory BIO:
BIO *mem = BIO_new(BIO_s_mem());
look at her go. queen behavior π
β¨ SEE ALSO β¨
all the sister pages, linked and loved π
BIO_ctrl(3)BIO_f_base64(3)BIO_f_buffer(3)BIO_f_cipher(3)BIO_f_md(3)BIO_f_null(3)BIO_f_ssl(3)BIO_f_readbuffer(3)BIO_find_type(3)BIO_get_conn_mode(3)BIO_new(3)BIO_new_bio_pair(3)BIO_push(3)BIO_read_ex(3)BIO_s_accept(3)BIO_s_bio(3)BIO_s_connect(3)BIO_s_fd(3)BIO_s_file(3)BIO_s_mem(3)BIO_s_null(3)BIO_s_socket(3)BIO_set_callback(3)BIO_set_conn_mode(3)BIO_set_tfo(3)BIO_set_tfo_accept(3)BIO_should_retry(3)
β¨ COPYRIGHT β¨
Copyright 2000-2022 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 π shoutout to version 3.5.6, dated 2026-04-07 β she's fresh, she's documented, she's slaying π β¨ bye pookie, go build something iconic ππ
π¦ 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