SSL_CTX_USE_SERVERINFO(3ossl)
β¨ NAME β¨
okay so this is the OpenSSL manual page for SSL_CTX_USE_SERVERINFO(3ossl), and it's literally about three little functions that let you load "serverinfo" TLS extensions into your SSL_CTX. Slay. The functions are:
SSL_CTX_use_serverinfo_ex()β the big sister with theversionparameterSSL_CTX_use_serverinfo()β the chill one that defaults toSSL_SERVERINFOV1SSL_CTX_use_serverinfo_file()β the one that reads from a PEM file
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
int SSL_CTX_use_serverinfo_ex(SSL_CTX *ctx, unsigned int version,
const unsigned char *serverinfo,
size_t serverinfo_length);
int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
size_t serverinfo_length);
int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);
π DESCRIPTION π
bestie, these functions load "serverinfo" TLS extensions into the SSL_CTX. A "serverinfo" extension gets returned in response to an empty ClientHello Extension. no cap. π«Ά
π the _ex one
SSL_CTX_use_serverinfo_ex() loads one or more serverinfo extensions from a byte array into ctx. The version parameter specifies the format of the byte array provided in *serverinfo, which is of length serverinfo_length. iconic.
If version is SSL_SERVERINFOV2, then the extensions in the array must consist of a 4-byte context, a 2-byte Extension Type, a 2-byte length, and then length bytes of extension_data. The context and type values have the same meaning as for SSL_CTX_add_custom_ext(3). If serverinfo is being loaded for extensions to be added to a Certificate message, then the extension will only be added for the first certificate in the message (which is always the end-entity certificate). literally the main character certificate.
If version is SSL_SERVERINFOV1, then the extensions in the array must consist of a 2-byte Extension Type, a 2-byte length, and then length bytes of extension_data. The type value has the same meaning as for SSL_CTX_add_custom_ext(3). The following default context value will be used in this case:
SSL_EXT_TLS1_2_AND_BELOW_ONLY | SSL_EXT_CLIENT_HELLO
| SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_IGNORE_ON_RESUMPTION
π the plain _serverinfo one
SSL_CTX_use_serverinfo() does the same thing as SSL_CTX_use_serverinfo_ex() except that there is no version parameter so a default version of SSL_SERVERINFOV1 is used instead. it's giving "I got you, bestie" energy.
π the _file one
SSL_CTX_use_serverinfo_file() loads one or more serverinfo extensions from file into ctx. The extensions must be in PEM format. Each extension must be in a format as described above for SSL_CTX_use_serverinfo_ex(). Each PEM extension name must begin with the phrase "BEGIN SERVERINFOV2 FOR " for SSL_SERVERINFOV2 data or "BEGIN SERVERINFO FOR " for SSL_SERVERINFOV1 data. π
β οΈ okay so this part is important: If more than one certificate (RSA/DSA) is installed usingSSL_CTX_use_certificate(), the serverinfo extension will be loaded into the last certificate installed. If e.g. the last item was an RSA certificate, the loaded serverinfo extension data will be loaded for that certificate. To use the serverinfo extension for multiple certificates,SSL_CTX_use_serverinfo()needs to be called multiple times, once after each time a certificate is loaded via a call toSSL_CTX_use_certificate(). don't forget or the vibe check will fail π
π«Ά RETURN VALUES π«Ά
On success, the functions return 1. On failure, the functions return 0. Check out the error stack to find out the reason. periodt. π
π₯ SEE ALSO π₯
ssl(7)β that's the only one, bestie. iykyk.
π COPYRIGHT π
Copyright 2013-2017 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! this is OpenSSL 3.5.0, dated 2026-09-25, and the manual name is SSL_CTX_USE_SERVERINFO(3ossl). bye! πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms