| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "BIO 7SSL" |
| 58 |
.TH BIO 7SSL 2026-04-07 3.6.2 OpenSSL |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
bio \- Basic I/O abstraction |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
.Vb 1 |
| 68 |
\& #include <openssl/bio.h> |
| 69 |
.Ve |
| 70 |
.SH DESCRIPTION |
| 71 |
.IX Header "DESCRIPTION" |
| 72 |
A BIO is an I/O abstraction, it hides many of the underlying I/O |
| 73 |
details from an application. If an application uses a BIO for its |
| 74 |
I/O it can transparently handle SSL connections, unencrypted network |
| 75 |
connections and file I/O. |
| 76 |
.PP |
| 77 |
There are two types of BIO, a source/sink BIO and a filter BIO. |
| 78 |
.PP |
| 79 |
As its name implies a source/sink BIO is a source and/or sink of data, |
| 80 |
examples include a socket BIO and a file BIO. |
| 81 |
.PP |
| 82 |
A filter BIO takes data from one BIO and passes it through to |
| 83 |
another, or the application. The data may be left unmodified (for |
| 84 |
example a message digest BIO) or translated (for example an |
| 85 |
encryption BIO). The effect of a filter BIO may change according |
| 86 |
to the I/O operation it is performing: for example an encryption |
| 87 |
BIO will encrypt data if it is being written to and decrypt data |
| 88 |
if it is being read from. |
| 89 |
.PP |
| 90 |
BIOs can be joined together to form a chain (a single BIO is a chain |
| 91 |
with one component). A chain normally consists of one source/sink |
| 92 |
BIO and one or more filter BIOs. Data read from or written to the |
| 93 |
first BIO then traverses the chain to the end (normally a source/sink |
| 94 |
BIO). |
| 95 |
.PP |
| 96 |
Some BIOs (such as memory BIOs) can be used immediately after calling |
| 97 |
\&\fBBIO_new()\fR. Others (such as file BIOs) need some additional initialization, |
| 98 |
and frequently a utility function exists to create and initialize such BIOs. |
| 99 |
.PP |
| 100 |
If \fBBIO_free()\fR is called on a BIO chain it will only free one BIO resulting |
| 101 |
in a memory leak. |
| 102 |
.PP |
| 103 |
Calling \fBBIO_free_all()\fR on a single BIO has the same effect as calling |
| 104 |
\&\fBBIO_free()\fR on it other than the discarded return value. |
| 105 |
.PP |
| 106 |
Normally the \fItype\fR argument is supplied by a function which returns a |
| 107 |
pointer to a BIO_METHOD. There is a naming convention for such functions: |
| 108 |
a source/sink BIO typically starts with \fIBIO_s_\fR and |
| 109 |
a filter BIO with \fIBIO_f_\fR. |
| 110 |
.SS "TCP Fast Open" |
| 111 |
.IX Subsection "TCP Fast Open" |
| 112 |
TCP Fast Open (RFC7413), abbreviated "TFO", is supported by the BIO |
| 113 |
interface since OpenSSL 3.2. TFO is supported in the following operating systems: |
| 114 |
.IP \(bu 4 |
| 115 |
Linux kernel 3.13 and later, where TFO is enabled by default. |
| 116 |
.IP \(bu 4 |
| 117 |
Linux kernel 4.11 and later, using TCP_FASTOPEN_CONNECT. |
| 118 |
.IP \(bu 4 |
| 119 |
FreeBSD 10.3 to 11.4, supports server TFO only. |
| 120 |
.IP \(bu 4 |
| 121 |
FreeBSD 12.0 and later, supports both client and server TFO. |
| 122 |
.IP \(bu 4 |
| 123 |
macOS 10.14 and later. |
| 124 |
.PP |
| 125 |
Each operating system has a slightly different API for TFO. Please |
| 126 |
refer to the operating systems' API documentation when using |
| 127 |
sockets directly. |
| 128 |
.SH EXAMPLES |
| 129 |
.IX Header "EXAMPLES" |
| 130 |
Create a memory BIO: |
| 131 |
.PP |
| 132 |
.Vb 1 |
| 133 |
\& BIO *mem = BIO_new(BIO_s_mem()); |
| 134 |
.Ve |
| 135 |
.SH "SEE ALSO" |
| 136 |
.IX Header "SEE ALSO" |
| 137 |
\&\fBBIO_ctrl\fR\|(3), |
| 138 |
\&\fBBIO_f_base64\fR\|(3), \fBBIO_f_buffer\fR\|(3), |
| 139 |
\&\fBBIO_f_cipher\fR\|(3), \fBBIO_f_md\fR\|(3), |
| 140 |
\&\fBBIO_f_null\fR\|(3), \fBBIO_f_ssl\fR\|(3), |
| 141 |
\&\fBBIO_f_readbuffer\fR\|(3), |
| 142 |
\&\fBBIO_find_type\fR\|(3), |
| 143 |
\&\fBBIO_get_conn_mode\fR\|(3), |
| 144 |
\&\fBBIO_new\fR\|(3), |
| 145 |
\&\fBBIO_new_bio_pair\fR\|(3), |
| 146 |
\&\fBBIO_push\fR\|(3), \fBBIO_read_ex\fR\|(3), |
| 147 |
\&\fBBIO_s_accept\fR\|(3), \fBBIO_s_bio\fR\|(3), |
| 148 |
\&\fBBIO_s_connect\fR\|(3), \fBBIO_s_fd\fR\|(3), |
| 149 |
\&\fBBIO_s_file\fR\|(3), \fBBIO_s_mem\fR\|(3), |
| 150 |
\&\fBBIO_s_null\fR\|(3), \fBBIO_s_socket\fR\|(3), |
| 151 |
\&\fBBIO_set_callback\fR\|(3), |
| 152 |
\&\fBBIO_set_conn_mode\fR\|(3), |
| 153 |
\&\fBBIO_set_tfo\fR\|(3), |
| 154 |
\&\fBBIO_set_tfo_accept\fR\|(3), |
| 155 |
\&\fBBIO_should_retry\fR\|(3) |
| 156 |
.SH COPYRIGHT |
| 157 |
.IX Header "COPYRIGHT" |
| 158 |
Copyright 2000\-2022 The OpenSSL Project Authors. All Rights Reserved. |
| 159 |
.PP |
| 160 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 161 |
this file except in compliance with the License. You can obtain a copy |
| 162 |
in the file LICENSE in the source distribution or at |
| 163 |
<https://www.openssl.org/source/license.html>. |