SSL_SET_BLOCKING_MODE(3SSL)
π SSL_SET_BLOCKING_MODE π
okay bestie, so likeβ¦ this is <pink>SSL_set_blocking_mode</pink> and <pink>SSL_get_blocking_mode</pink>, and they live in the <cyan>OpenSSL</cyan> manual, section <purple>3SSL</purple>. Which means they're library functions, not a command you type in a shell. Yes. Sit with me. π«Ά
Basically: these two functions let you turn blocking mode on and off for a QUIC connection SSL object. That's the whole gig. IT'S GIVING very specific. π
β¨ SYNOPSIS β¨
#include <openssl/ssl.h>
int SSL_set_blocking_mode(SSL *s, int blocking);
int SSL_get_blocking_mode(SSL *s);
look at her. two little one-liners. iconic. π
πΈ DESCRIPTION πΈ
so SSL_set_blocking_mode() is the one you call when you wanna enable or disable blocking mode on a QUIC connection SSL object. no cap.
by default, blocking is ENABLED β unless the SSL object is configured to use an underlying read or write BIO that cannot provide a poll descriptor (peep BIO_get_rpoll_descriptor(3)), because in that case blocking mode literally cannot be supported. the vibes are simply not there. π
so to turn it on, you call SSL_set_blocking_mode() with blocking set to 1. to turn it OFF, you call SSL_set_blocking_mode() with blocking set to 0. that's it. that's the bit. π
and when you wanna know what mode you're currently in? you call SSL_get_blocking_mode(). vibe check, basically. β¨
now, what even IS blocking mode, bestie? I got you:
- blocking mode = calls like
SSL_read()andSSL_write()will block until the requested operation can actually be performed. they just sit there. patiently. waiting. like a good friend outside the fitting room. π - nonblocking mode = those same calls will FAIL if the requested operation can't be performed immediately. see
SSL_get_error(3)for what to do about that.
important detail incoming, don't scroll π
these functions are only applicable to QUIC connection SSL objects. periodt. other kinds of SSL object β like the ones for TLS β automatically function in blocking or nonblocking mode based on whether the underlying network read and write BIOs you gave the SSL object are themselves configured in nonblocking mode. so, like, TLS handles its own business. she doesn't need you micromanaging. π¦
so if you're using a QUIC connection SSL object in nonblocking mode, then you (yes, you, the application) are responsible for making sure the SSL object gets ticked regularly. see SSL_handle_events(3). don't ghost her. tick her. π§
ooh and one more thing β blocking mode gets disabled automatically if the application provides a QUIC connection SSL object with a network BIO that can't support blocking mode. sad. tragic. but here's the recovery arc: to re-enable blocking mode in that case, the application must set a network BIO which CAN support blocking mode, and then explicitly call SSL_set_blocking_mode(). you gotta say it out loud. manifest it. π
π RETURN VALUES π
SSL_set_blocking_mode()β returns1on success,0on failure. and it FAILS if you call it on an SSL object that doesn't represent a QUIC connection, or if blocking mode can't be used for the given connection. rip. πSSL_get_blocking_mode()β returns1if blocking is currently enabled. it returns-1if you called it on an unsupported SSL object. so like, wrong object, wrong place, no info for you. π
π¦ SEE ALSO π¦
go read them. it's giving research. β¨π
β HISTORY β
the SSL_set_blocking_mode() and SSL_get_blocking_mode() functions were added in OpenSSL 3.2. new-ish girls on the block. π
π COPYRIGHT π
Copyright 2022-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>.
okay that's the whole page bestie, no notes, you understood all of it, I'm so proud of you honestly ππ«Ά this was <rainbow>OpenSSL 4.0.3</rainbow>, dated 2026-09-29, and it's the <pink>SSL_SET_BLOCKING_MODE(3SSL)</pink> page. go be the main character of your own QUIC connection. mwah π
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms