LIBRESSL-SSL_CTX_SET_TLSEXT_USE_SRTP(3)
πΈ NAME πΈ
Okay so bestie, welcome to the SSL_CTX_SET_TLSEXT_USE_SRTP(3) page from the Library Functions Manual π It's all about SSL_CTX_set_tlsext_use_srtp, SSL_set_tlsext_use_srtp, SSL_get_srtp_profiles, and SSL_get_selected_srtp_profile β literally the squad for configuring and querying SRTP support β¨
π¦ SYNOPSIS π¦
No cap, here's the exact shape of things:
library βlibsslβ libcrypto #include <openssl/srtp.h>
int
SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
int
SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles);
STACK_OF(SRTP_PROTECTION_PROFILE) *
SSL_get_srtp_profiles(SSL *ssl);
SRTP_PROTECTION_PROFILE *
SSL_get_selected_srtp_profile(SSL *ssl);
π DESCRIPTION π
SRTP is the Secure Real-Time Transport Protocol, and OpenSSL implements support for the "use_srtp" DTLS extension defined in RFC 5764 π₯ This gives you a mechanism for establishing SRTP keying material, algorithms and parameters using DTLS. This capability may be used as part of an implementation that conforms to RFC 5763. OpenSSL does not implement SRTP itself or RFC 5763, periodt.
Tiny but important vibe check π OpenSSL does not support the use of SRTP Master Key Identifiers (MKIs). Also note that this extension is only supported in DTLS. Any SRTP configuration is ignored if a TLS connection is attempted π
An OpenSSL client wishing to send the "use_srtp" extension should call SSL_CTX_set_tlsext_use_srtp() to set its use for all SSL objects subsequently created from ctx π«Ά Alternatively a client may call SSL_set_tlsext_use_srtp() to set its use for an individual SSL object. The profiles parameter should point to a NUL-terminated, colon delimited list of SRTP protection profile names β¨
The currently supported protection profile names are:
SRTP_AES128_CM_SHA1_80β this corresponds toSRTP_AES128_CM_HMAC_SHA1_80defined in RFC 5764.SRTP_AES128_CM_SHA1_32β this corresponds toSRTP_AES128_CM_HMAC_SHA1_32defined in RFC 5764.SRTP_AEAD_AES_128_GCMβ this corresponds toSRTP_AEAD_AES_128_GCMdefined in RFC 7714.SRTP_AEAD_AES_256_GCMβ this corresponds toSRTP_AEAD_AES_256_GCMdefined in RFC 7714.
Supplying an unrecognised protection profile name results in an error π
An OpenSSL server wishing to support the "use_srtp" extension should also call SSL_CTX_set_tlsext_use_srtp() or SSL_set_tlsext_use_srtp() to indicate the protection profiles that it is willing to negotiate π
The currently configured list of protection profiles for either a client or a server can be obtained by calling SSL_get_srtp_profiles() π
This returns a stack of SRTP_PROTECTION_PROFILE objects. The memory pointed to in the return value of this function should not be freed by the caller β not me freeing that, nope π
After a handshake has been completed, the negotiated SRTP protection profile (if any) can be obtained (on the client or the server) by calling SSL_get_selected_srtp_profile(). This function returns NULL if no SRTP protection profile was negotiated. The memory returned from this function should not be freed by the caller π§
If an SRTP protection profile has been successfully negotiated, then the SRTP keying material (on both the client and server) should be obtained by calling SSL_export_keying_material(3) with a label of "EXTRACTOR-dtls_srtp", a context of NULL, and a use_context argument of 0 π The total length of keying material obtained should be equal to two times the sum of the master key length and the salt length as defined for the protection profile in use. This provides the client write master key, the server write master key, the client write master salt and the server write master salt in that order β
π RETURN VALUES π
- Contrary to OpenSSL conventions,
SSL_CTX_set_tlsext_use_srtp()andSSL_set_tlsext_use_srtp()return0on success or1on error π³ yes, they're built different. SSL_get_srtp_profiles()returns a stack ofSRTP_PROTECTION_PROFILEobjects on success orNULLon error or if no protection profiles have been configured.SSL_get_selected_srtp_profile()returns a pointer to anSRTP_PROTECTION_PROFILEobject if one has been negotiated orNULLotherwise.
π SEE ALSO π
π HISTORY π
These functions first appeared in OpenSSL 1.0.1 and have been available since OpenBSD 5.3 π¦
xoxo, your Debian bestie π
β Debian, June 8, 2025, SSL_CTX_SET_TLSEXT_USE_SRTP(3) π«Ά
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2017 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms