BIO(7SSL)
π
BIO(7SSL) β the bio manual page, but make it bestie-core
okay so bestie, you're reading the manual page for bio β that's the Basic I/O abstraction from OpenSSL β¨ it lives in section 7SSL and honestly? it's lowkey the moment.
β¨ SYNOPSIS β¨
#include <openssl/bio.h>
that's it. one include. iconique. π
π¦ DESCRIPTION π¦
okay so a BIO is an I/O abstraction, right? which basically means it hides a whole bunch of the underlying I/O details from your application. the way that works: if your app does its I/O through a BIO, it can transparently handle SSL connections, unencrypted network connections and file I/O without you having to rewire everything. main character energy fr fr. π
There are two types of BIO, bestie:
- a source/sink BIO
- 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. it's giving "data comes from here / data goes here". π
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 here's the cute part: 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!! π
BIOs can be joined together to form a chain (a single BIO is a chain with one component, yes really, a chain of one, slay). 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 a whole relay race and everyone's doing their part πββοΈβ¨
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. so check before you assume, ok? π
β οΈ bestie listen. If BIO_free() is called on a BIO chain it will only free one BIO β resulting in a memory leak. not the vibe. do not do this. π
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, iykyk: a source/sink BIO typically starts with BIO_s_ and a filter BIO with BIO_f_. πΈ
π 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. (aka: read their docs, not just this one, bestie π«Ά)
π EXAMPLES π
Create a memory BIO:
BIO *mem = BIO_new(BIO_s_mem());
look at her. tiny. perfect. doing so much. β
π SEE ALSO π
go read these too, they're all in the family:
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>. (no links in here normally but the original literally has one so here she is π
)
and that's the whole page, bestie π§ this was OpenSSL version 4.0.3, dated 2026-09-29, filed under BIO(7SSL) β so you know exactly which era of the docs you're reading. go forth and chain your BIOs responsibly, mwah πβ¨
π¦ where this page comes from
- ubuntu stonking: openssl 4.0.3-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms