SSL_SET_BLOCKING_MODE(3ossl)

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

✨ SSL_SET_BLOCKING_MODE(3ossl) ✨

okay bestie, so this is a page from the OpenSSL manual, section 3ossl β€” and it's literally all about telling your QUIC connection whether it's allowed to vibe in blocking mode or not. πŸ¦‹


πŸ’… NAME

SSL_set_blocking_mode, SSL_get_blocking_mode β€” configure blocking mode for a QUIC SSL object ✨


🌸 SYNOPSIS

#include <openssl/ssl.h>

int SSL_set_blocking_mode(SSL *s, int blocking);
int SSL_get_blocking_mode(SSL *s);

πŸŽ€ DESCRIPTION

So like, SSL_set_blocking_mode() is your girl for turning blocking mode on or off 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 can't provide a poll descriptor (peep BIO_get_rpoll_descriptor(3) for that one), because bestie, blocking mode literally cannot be supported in that case. πŸ’€

Want blocking mode ON? Call SSL_set_blocking_mode() with blocking set to 1. Want it OFF? Call it with blocking set to 0. That's it, that's the whole vibe check. ✨

Wanna know what mode you're currently in? Call SSL_get_blocking_mode(). πŸ‘‘

  • Blocking mode means calls like SSL_read() and SSL_write() will block until the requested operation can actually be performed. They wait. Patiently. 🧚
  • Nonblocking mode means those same calls will fail if the requested operation can't be performed immediately β€” see SSL_get_error(3) for how to deal with that.
Important: these functions are only applicable to QUIC connection SSL objects. 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 handed to the SSL object are themselves configured in nonblocking mode. So don't come at them with these functions, iykyk. πŸ’…

Where a QUIC connection SSL object is used in nonblocking mode, the application is responsible for making sure the SSL object gets ticked regularly β€” see SSL_handle_events(3). Like, that's on you, bestie. Don't forget to tick. ⏰

And okay, here's a lil gotcha πŸ™ˆ β€” blocking mode gets disabled automatically if the application provides a QUIC connection SSL object with a network BIO that can't support blocking mode. If you wanna re-enable blocking mode in that case, the application must set a network BIO that can support blocking mode and then explicitly call SSL_set_blocking_mode(). No sneaky auto-re-enable, periodt. ✨


πŸ’– RETURN VALUES

  • SSL_set_blocking_mode() returns 1 on success and 0 on failure. It fails if you call it on an SSL object that doesn't represent a QUIC connection, or if blocking mode just can't be used for the given connection. 😭
  • SSL_get_blocking_mode() returns 1 if blocking is currently enabled. It returns -1 if you call it on an unsupported SSL object. πŸ’€

🌈 SEE ALSO

SSL_handle_events(3), SSL_poll(3), openssl-quic(7), openssl-quic-concurrency(7), ssl(7)


⭐ HISTORY

The SSL_set_blocking_mode() and SSL_get_blocking_mode() functions were added in OpenSSL 3.2. Iconic behaviour honestly. πŸ‘‘


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>.


and that's the whole page, bestie!! πŸŽ€ this was version 3.5.0, dated 2026-09-25, and it lives at SSL_SET_BLOCKING_MODE(3ossl) in the OpenSSL docs β€” go forth and block (or don't) responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from