nbd_set_uri_allow_tls(3)
π NAME
Okay bestie, this is nbd_set_uri_allow_tls(3) from the libnbd manual, and it does exactly one thing: it sets the allowed TLS settings in NBD URIs. That's the whole vibe. β¨
β¨ SYNOPSIS
#include <libnbd.h>
int nbd_set_uri_allow_tls (
struct nbd_handle *h, int tls
);
Like, you hand it a handle and a tls value, and it just gets it. π«Ά
π DESCRIPTION
So basically this is the little function that decides which TLS settings are even allowed to show up inside NBD URIs. Out of the box, the default is to allow either non-TLS or TLS URIs β very "you do you, bestie" energy. π
The tls parameter can be:
LIBNBD_TLS_DISABLEβ TLS URIs are not permitted, periodt. A URI likenbds://...will be rejected. Ngl, it's giving "we don't do that here." πLIBNBD_TLS_ALLOWβ this is the default. TLS may be used or not, depending on whether the URI usesnbdsornbd. Lowkey the most chill option. π¦LIBNBD_TLS_REQUIREβ TLS URIs are required. All URIs must usenbds. No exceptions, no negotiating, main character energy only. π
π₯ RETURN VALUE
If the call is successful the function returns 0. Slay. β
π ERRORS
On error -1 is returned. π
Refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error β that's where the actual tea is. π
The following parameters must not be NULL: h. For more information see "Non-NULL parameters" in libnbd(3). Like, do not pass a NULL handle, I am begging you. π
π¦ HANDLE STATE
nbd_set_uri_allow_tls can be called when the handle is in the following state:
- Handle created, before connecting β β allowed
- Connecting β β error
- Connecting & handshaking (
opt_mode) β β error - Connected to the server β β error
- Connection shut down β β error
- Handle dead β β error
So yeah β it's a "before you connect" kinda function. Timing is everything, iykyk. β
πΈ VERSION
This function first appeared in libnbd 1.2. She's been iconic for a minute. π
If you need to test if this function is available at compile time check if the following macro is defined:
#define LIBNBD_HAVE_NBD_SET_URI_ALLOW_TLS 1
π SEE ALSO
nbd_connect_uri(3), nbd_create(3), nbd_set_uri_allow_transports(3), libnbd(3).
Go read the whole squad, fr fr. π
π«Ά AUTHORS
Eric Blake
Richard W.M. Jones
π COPYRIGHT
Copyright Red Hat
β LICENSE
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. π
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. π§
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Okay that's the whole page, bestie β this was libnbd-1.25.8, dated 2026-10-13, and it's the nbd_set_uri_allow_tls(3) manual page. Now go forth and configure your TLS settings correctly π
β¨π
π¦ where this page comes from
- centos-stream 10: libnbd-devel 1.25.8-1.el10 Β· LGPL-2.0-or-later AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms