SSL_GET_FD(3ossl)
π SSL_GET_FD β get file descriptor linked to an SSL object
okay bestie so this is a page from the OpenSSL manuals, the 3ossl girlies, and it's about three little functions that do the very specific job of telling you which file descriptor your SSL object is attached to π
β¨ NAME β¨
SSL_get_fd, SSL_get_rfd, SSL_get_wfd β get file descriptor linked to an SSL object π¦
β¨ SYNOPSIS β¨
#include <openssl/ssl.h>
int SSL_get_fd(const SSL *ssl);
int SSL_get_rfd(const SSL *ssl);
int SSL_get_wfd(const SSL *ssl);
β¨ DESCRIPTION β¨
so like, three functions, one mission π
SSL_get_fd()β returns the file descriptor which is linked tossl. that's it, that's the vibe.SSL_get_rfd()andSSL_get_wfd()β these two return the file descriptors for the read or the write channel, and no cap, those two can literally be different from each other. π
and here's the tea: if the read and the write channel are different, SSL_get_fd() will return the file descriptor of the read channel. so it's basically the read one's main character moment. π
β¨ RETURN VALUES β¨
here's what you can get back, bestie:
-1β the operation failed π because the underlyingBIOis not of the correct type (suitable for file descriptors). wrong type, wrong vibe, it's giving incompatible.>=0β the file descriptor linked tossl. slay, that's the one you wanted. β¨
β¨ SEE ALSO β¨
go read those too, iykyk π«Ά
β¨ COPYRIGHT β¨
Copyright 2000-2016 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>.
okay that's the whole page, no notes, ate and left no crumbs π
πΈ this was OpenSSL 3.5.9, dated 2026-09-29, mwah π bye bestie, go close your file descriptors πβ
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms