nbd_set_tls_verify_peer(3)
π nbd_set_tls_verify_peer(3) β like, the libnbd manual, but make it make sense
okay so bestie, welcome to the LIBNBD corner of the man pages π this one is all about nbd_set_tls_verify_peer β say that five times fast, i dare you β and it's genuinely important if you care whether the server you're talking to is actually who it says it is. spoiler: you should care. π¦
β¨ NAME β¨
nbd_set_tls_verify_peer β set whether we verify the identity of the server π
like, do we trust this server or not. that's the whole vibe check.
πΈ SYNOPSIS πΈ
#include <libnbd.h>
int nbd_set_tls_verify_peer (
struct nbd_handle *h, bool verify
);
she's small, she's cute, she takes a handle and a bool. iconic behavior honestly.
π DESCRIPTION π
okay so, real talk: you set this flag to control whether libnbd will verify the identity of the server, using the server's certificate plus the certificate authority. that's it, that's the whole function. π«Ά
the default is lowkey smart: it defaults to true when you're connecting to TCP servers using TLS certificate authentication, and false otherwise. so if you're doing the certificate thing, libnbd is already looking out for you β no cap. π₯
this function may be called regardless of whether TLS is supported, but β and this is the part where you pay attention, bestie π β it will have no effect unless nbd_set_tls(3) is also used to request or require TLS. like, you can flip this switch all you want, but if TLS isn't even turned on, the switch is just... decor. π
β RETURN VALUE β
if the call is successful the function returns 0. slay. β¨
π ERRORS π
on error -1 is returned. rude, but okay. π
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". like, do NOT pass a NULL handle, that's not the move. for more information see "Non-NULL parameters" in libnbd(3).
π HANDLE STATE π
nbd_set_tls_verify_peer can be called when the handle is in the following state:
- β Handle created, before connecting β allowed, this is your moment
- β Connecting β error
- β Connecting & handshaking (
opt_mode) β error - β Connected to the server β error
- β Connection shut down β error
- β Handle dead β error
so basically: before you connect, or nothing. it's giving "you had one shot" energy. π
π¦ VERSION π¦
this function first appeared in libnbd 1.0. a classic, an OG, a main character. π
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_TLS_VERIFY_PEER 1
π SEE ALSO π
(the get one is right there if you ever wanna peek at what you set, iykyk π)
π AUTHORS π
- Eric Blake
- Richard W.M. Jones
legends, honestly. π«‘
π§ 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, you ate that π«Ά this was libnbd-1.25.8, dated 2026-10-13, and the page is nbd_set_tls_verify_peer(3) β mwah, go verify some peers responsibly πβ¨
π¦ 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