OSSL-GUIDE-L...INTRODUCTION(7ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… ossl-guide-libssl-introduction, ssl β€” OpenSSL Guide: An introduction to libssl πŸ¦‹

Okay bestie, welcome to the libssl glow-up tour ✨ this is 7ossl by the way, and honestly? It's giving "the SSL/TLS manual but make it make sense." Let's go πŸ’–


🌸 INTRODUCTION 🌸

So the OpenSSL libssl library? It provides implementations of several secure network communications protocols. Specifically, it's serving:

  • SSL/TLS (SSLv3, TLSv1, TLSv1.1, TLSv1.2 and TLSv1.3)
  • DTLS (DTLSv1 and DTLSv1.2)
  • QUIC β€” and that's client side only, iykyk πŸ‘€

This library lowkey depends on libcrypto for all its underlying cryptographic operations, so if you need that intro go peek at ossl-guide-libcrypto-introduction(7) 🫢

The way this works is: the set of APIs supplied by libssl is common across all of these different network protocols, so a developer who already slays at writing apps with one of them should be able to transition to another with relative ease. Iconic behavior, honestly πŸ‘‘

An application written to use libssl will include the <openssl/ssl.h> header file, and will typically use two main data structures, i.e. SSL and SSL_CTX. Those are the main characters πŸ’…


🌈 The SSL object

An SSL object is used to represent a connection to a remote peer. Once a connection with a remote peer has been established, data can be exchanged with that peer. Simple, clean, gorgeous ✨

When you're using DTLS, any data that's exchanged uses "datagram" semantics, i.e. the packets of data can be delivered in any order, and they are not guaranteed to arrive at all 😭 (yeah. that's the vibe. chaotic delivery.) In this case the SSL object used for the connection is also used for exchanging data with the peer.

Both TLS and QUIC support the concept of a "stream" of data. Data sent via a stream is guaranteed to be delivered in order without any data loss. A stream can be uni- or bi-directional πŸ¦‹

SSL/TLS only supports one stream of data per connection, and it is always bi-directional. In this case the SSL object used for the connection also represents that stream. See ossl-guide-tls-introduction(7) for more info πŸ’–

The QUIC protocol can support multiple streams per connection, and they can be uni- or bi-directional. In this case an SSL object can represent the underlying connection, or a stream, or both. Where multiple streams are in use, a separate SSL object is used for each one. See ossl-guide-quic-introduction(7) for more info 🌟


πŸŽ€ The SSL_CTX object

An SSL_CTX object is used to create the SSL object for the underlying connection. A single SSL_CTX object can be used to create many connections β€” each one represented by a separate SSL object. It's the mother of the group chat, fr fr.

Many API functions in libssl exist in two forms: one that takes an SSL_CTX and one that takes an SSL. Typically, settings that you apply to the SSL_CTX will then be inherited by any SSL object that you create from it. Alternatively you can apply settings directly to the SSL object without affecting other SSL objects πŸ™ˆ

⚠️ Note that you should not normally make changes to an SSL_CTX after the first SSL object has been created from it. Like, don't do it. That's not the move πŸ’€

🧚 DATA STRUCTURES 🧚

As well as SSL_CTX and SSL, there are a number of other data structures that an application may need to use. They are summarised below πŸ‘‡

🌸 SSL_METHOD (SSL Method)

This structure is used to indicate the kind of connection you want to make, e.g. whether it's to represent the client or the server, and whether it's to use SSL/TLS, DTLS or QUIC. It's passed as a parameter when creating the SSL_CTX ✨

πŸ¦‹ SSL_SESSION (SSL Session)

After establishing a connection with a peer, the agreed cryptographic material can be reused to create future connections with the same peer more rapidly. The set of data used for such a future connection establishment attempt is collected together into an SSL_SESSION object. A single successful connection with a peer may generate zero or more such SSL_SESSION objects for use in future connection attempts. So many possibilities, so little time πŸ’…

πŸ’œ SSL_CIPHER (SSL Cipher)

During connection establishment the client and server agree upon cryptographic algorithms they're going to use for encryption and other uses. A single set of cryptographic algorithms that are to be used together is known as a ciphersuite. Such a set is represented by an SSL_CIPHER object πŸ”₯

The set of available ciphersuites that can be used are configured in the SSL_CTX or SSL πŸ‘‘


πŸ“š FURTHER READING πŸ“š

See ossl-guide-tls-introduction(7) for an introduction to the SSL/TLS protocol, and ossl-guide-quic-introduction(7) for an introduction to QUIC πŸ¦‹

See ossl-guide-libcrypto-introduction(7) for an introduction to libcrypto πŸ’–


πŸ‘€ SEE ALSO πŸ‘€


Copyright 2000-2025 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>.


That's the whole thing bestie, you ate that 🫢✨ And listen β€” this page is from the OpenSSL 3.5.0 era, dated 2026-09-25, so if you're quoting it in the group chat, cite your source, periodt πŸ’…πŸŽ€

πŸ“¦ where this page comes from