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 like nbds://... 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 uses nbds or nbd. Lowkey the most chill option. πŸ¦‹
  • LIBNBD_TLS_REQUIRE β€” TLS URIs are required. All URIs must use nbds. 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 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