SSL_SET_BLOCKING_MODE(3ossl)
π SSL_SET_BLOCKING_MODE(3ossl) β the OpenSSL glow-up
okay bestie, sit DOWN because we're talking about SSL_set_blocking_mode and SSL_get_blocking_mode, two little functions from the OpenSSL manual (3ossl, iykyk) that decide whether your QUIC connection is a "wait for it π" girlie or a "if it's not instant I'm out πβοΈ" girlie. blocking mode configuration, no cap.
β¨ 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 π
SSL_set_blocking_mode() is your girl for turning blocking mode on or off on a QUIC connection SSL object. And like, by default? Blocking is enabled, periodt. The one exception is when the SSL object is set up 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. it's giving "not possible, bestie" π
Wanna enable blocking mode? Call SSL_set_blocking_mode() with blocking set to 1. Wanna disable it? Call SSL_set_blocking_mode() with blocking set to 0. iconic. simple. slay.
To find out what mode you're currently in, call SSL_get_blocking_mode(). vibe check your own connection π
So what does blocking mode mean? It means calls like SSL_read() and SSL_write() will block until the requested operation can actually be performed. Very "I'll wait for you, babe π«Ά". In nonblocking mode, those same calls will just fail if the operation can't be performed immediately β and then you go check SSL_get_error(3). no waiting, no patience, main character energy only β¨
Heads up! 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 depending on whether the underlying network read and write BIOs handed to the SSL object are themselves configured in nonblocking mode. so like, TLS handles its own business, we don't manage it here π
And if you're using a QUIC connection SSL object in nonblocking mode, the application is responsible for making sure the SSL object gets ticked regularly. see SSL_handle_events(3). yes, you have to keep checking in on it. it's a needy little thing and we love that for it π§
One more thing, and this is lowkey important: blocking mode gets disabled automatically if the application gives a QUIC connection SSL object a network BIO that cannot support blocking mode. To re-enable blocking mode after that happens, the application must set a network BIO which can support blocking mode and explicitly call SSL_set_blocking_mode(). no shortcuts, bestie, you have to do both πΈ
π₯ RETURN VALUES π₯
SSL_set_blocking_mode()β returns1on success and0on failure. 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. so like, wrong girlie, wrong vibe πSSL_get_blocking_mode()β returns1if blocking is currently enabled. It returns-1if called on an unsupported SSL object. brutal but honest π
π SEE ALSO π
π°οΈ HISTORY π°οΈ
The SSL_set_blocking_mode() and SSL_get_blocking_mode() functions were added in OpenSSL 3.2. they're new-ish but they ate π
Β©οΈ 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>.
and that's the whole page, bestie π«Ά this was SSL_SET_BLOCKING_MODE(3ossl) from OpenSSL 3.5.9, dated 2026-09-29. go forth and configure your blocking mode responsibly β¨π
π¦ 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