| 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 "OSSL-GUIDE-LIBSSL-INTRODUCTION 7SSL" |
| 58 |
.TH OSSL-GUIDE-LIBSSL-INTRODUCTION 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 |
ossl\-guide\-libssl\-introduction, ssl |
| 65 |
\&\- OpenSSL Guide: An introduction to libssl |
| 66 |
.SH INTRODUCTION |
| 67 |
.IX Header "INTRODUCTION" |
| 68 |
The OpenSSL \f(CW\*(C`libssl\*(C'\fR library provides implementations of several secure network |
| 69 |
communications protocols. Specifically it provides SSL/TLS (SSLv3, TLSv1, |
| 70 |
TLSv1.1, TLSv1.2 and TLSv1.3), DTLS (DTLSv1 and DTLSv1.2) and QUIC (client side |
| 71 |
only). The library depends on \f(CW\*(C`libcrypto\*(C'\fR for its underlying cryptographic |
| 72 |
operations (see \fBossl\-guide\-libcrypto\-introduction\fR\|(7)). |
| 73 |
.PP |
| 74 |
The set of APIs supplied by \f(CW\*(C`libssl\*(C'\fR is common across all of these different |
| 75 |
network protocols, so a developer familiar with writing applications using one |
| 76 |
of these protocols should be able to transition to using another with relative |
| 77 |
ease. |
| 78 |
.PP |
| 79 |
An application written to use \f(CW\*(C`libssl\*(C'\fR will include the \fI<openssl/ssl.h>\fR |
| 80 |
header file and will typically use two main data structures, i.e. \fBSSL\fR and |
| 81 |
\&\fBSSL_CTX\fR. |
| 82 |
.PP |
| 83 |
An \fBSSL\fR object is used to represent a connection to a remote peer. Once a |
| 84 |
connection with a remote peer has been established data can be exchanged with |
| 85 |
that peer. |
| 86 |
.PP |
| 87 |
When using DTLS any data that is exchanged uses "datagram" semantics, i.e. |
| 88 |
the packets of data can be delivered in any order, and they are not guaranteed |
| 89 |
to arrive at all. In this case the \fBSSL\fR object used for the connection is also |
| 90 |
used for exchanging data with the peer. |
| 91 |
.PP |
| 92 |
Both TLS and QUIC support the concept of a "stream" of data. Data sent via a |
| 93 |
stream is guaranteed to be delivered in order without any data loss. A stream |
| 94 |
can be uni\- or bi-directional. |
| 95 |
.PP |
| 96 |
SSL/TLS only supports one stream of data per connection and it is always |
| 97 |
bi-directional. In this case the \fBSSL\fR object used for the connection also |
| 98 |
represents that stream. See \fBossl\-guide\-tls\-introduction\fR\|(7) for more |
| 99 |
information. |
| 100 |
.PP |
| 101 |
The QUIC protocol can support multiple streams per connection and they can be |
| 102 |
uni\- or bi-directional. In this case an \fBSSL\fR object can represent the |
| 103 |
underlying connection, or a stream, or both. Where multiple streams are in use |
| 104 |
a separate \fBSSL\fR object is used for each one. See |
| 105 |
\&\fBossl\-guide\-quic\-introduction\fR\|(7) for more information. |
| 106 |
.PP |
| 107 |
An \fBSSL_CTX\fR object is used to create the \fBSSL\fR object for the underlying |
| 108 |
connection. A single \fBSSL_CTX\fR object can be used to create many connections |
| 109 |
(each represented by a separate \fBSSL\fR object). Many API functions in libssl |
| 110 |
exist in two forms: one that takes an \fBSSL_CTX\fR and one that takes an \fBSSL\fR. |
| 111 |
Typically settings that you apply to the \fBSSL_CTX\fR will then be inherited by |
| 112 |
any \fBSSL\fR object that you create from it. Alternatively you can apply settings |
| 113 |
directly to the \fBSSL\fR object without affecting other \fBSSL\fR objects. Note that |
| 114 |
you should not normally make changes to an \fBSSL_CTX\fR after the first \fBSSL\fR |
| 115 |
object has been created from it. |
| 116 |
.SH "DATA STRUCTURES" |
| 117 |
.IX Header "DATA STRUCTURES" |
| 118 |
As well as \fBSSL_CTX\fR and \fBSSL\fR there are a number of other data structures |
| 119 |
that an application may need to use. They are summarised below. |
| 120 |
.IP "\fBSSL_METHOD\fR (SSL Method)" 4 |
| 121 |
.IX Item "SSL_METHOD (SSL Method)" |
| 122 |
This structure is used to indicate the kind of connection you want to make, e.g. |
| 123 |
whether it is to represent the client or the server, and whether it is to use |
| 124 |
SSL/TLS, DTLS or QUIC. It is passed as a parameter when creating |
| 125 |
the \fBSSL_CTX\fR. |
| 126 |
.IP "\fBSSL_SESSION\fR (SSL Session)" 4 |
| 127 |
.IX Item "SSL_SESSION (SSL Session)" |
| 128 |
After establishing a connection with a peer the agreed cryptographic material |
| 129 |
can be reused to create future connections with the same peer more rapidly. The |
| 130 |
set of data used for such a future connection establishment attempt is collected |
| 131 |
together into an \fBSSL_SESSION\fR object. A single successful connection with a |
| 132 |
peer may generate zero or more such \fBSSL_SESSION\fR objects for use in future |
| 133 |
connection attempts. |
| 134 |
.IP "\fBSSL_CIPHER\fR (SSL Cipher)" 4 |
| 135 |
.IX Item "SSL_CIPHER (SSL Cipher)" |
| 136 |
During connection establishment the client and server agree upon cryptographic |
| 137 |
algorithms they are going to use for encryption and other uses. A single set |
| 138 |
of cryptographic algorithms that are to be used together is known as a |
| 139 |
ciphersuite. Such a set is represented by an \fBSSL_CIPHER\fR object. |
| 140 |
.Sp |
| 141 |
The set of available ciphersuites that can be used are configured in the |
| 142 |
\&\fBSSL_CTX\fR or \fBSSL\fR. |
| 143 |
.SH "FURTHER READING" |
| 144 |
.IX Header "FURTHER READING" |
| 145 |
See \fBossl\-guide\-tls\-introduction\fR\|(7) for an introduction to the SSL/TLS |
| 146 |
protocol and \fBossl\-guide\-quic\-introduction\fR\|(7) for an introduction to QUIC. |
| 147 |
.PP |
| 148 |
See \fBossl\-guide\-libcrypto\-introduction\fR\|(7) for an introduction to \f(CW\*(C`libcrypto\*(C'\fR. |
| 149 |
.SH "SEE ALSO" |
| 150 |
.IX Header "SEE ALSO" |
| 151 |
\&\fBossl\-guide\-libcrypto\-introduction\fR\|(7), \fBossl\-guide\-tls\-introduction\fR\|(7), |
| 152 |
\&\fBossl\-guide\-quic\-introduction\fR\|(7) |
| 153 |
.SH COPYRIGHT |
| 154 |
.IX Header "COPYRIGHT" |
| 155 |
Copyright 2000\-2025 The OpenSSL Project Authors. All Rights Reserved. |
| 156 |
.PP |
| 157 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 158 |
this file except in compliance with the License. You can obtain a copy |
| 159 |
in the file LICENSE in the source distribution or at |
| 160 |
<https://www.openssl.org/source/license.html>. |