nbd_get_tls_negotiated(3)
hey bestie π welcome to the nbd_get_tls_negotiated(3) page β this one lives in the LIBNBD manual, and itβs all about checking whether TLS actually got negotiated on a connection β¨
π NAME π
nbd_get_tls_negotiated β find out if TLS was negotiated on a connection. Thatβs the whole assignment, no cap π
β¨ SYNOPSIS β¨
#include <libnbd.h>
int nbd_get_tls_negotiated (
struct nbd_handle *h
);
π¦ DESCRIPTION π¦
After youβve connected, you can call this to find out whether the connection is using TLS. Itβs normally useful only if you set the TLS request mode to LIBNBD_TLS_ALLOW (peep nbd_set_tls(3)), because in that mode it tries to use TLS but falls back to unencrypted if TLS wasnβt available. This function tells you whether TLS was negotiated or not, periodt. π₯
In LIBNBD_TLS_REQUIRE mode (the most secure one), the connection would have failed if TLS could not be negotiated. With LIBNBD_TLS_DISABLE mode, TLS is not tried automatically; but if the NBD server uses the less-common SELECTIVETLS mode, this function reports whether a manual nbd_opt_starttls(3) enabled TLS or if the connection is still plaintext. iykyk π
π RETURN VALUE π
This call returns a boolean value. Thatβs it, thatβs the tea π
π¨ ERRORS π¨
On error -1 is returned. π
Refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error.
The following parameters must not be NULL: h. For more information see "Non-NULL parameters" in libnbd(3). Donβt pass a NULL handle, bestie β thatβs not the vibe. π
π¦ HANDLE STATE π¦
nbd_get_tls_negotiated can be called when the handle is in these states:
- Handle created, before connecting β β error
- Connecting β β error
- Connecting & handshaking (opt_mode) β β allowed
- Connected to the server β β allowed
- Connection shut down β β allowed
- Handle dead β β error
πΈ VERSION πΈ
This function first appeared in libnbd 1.2.
If you need to test if this function is available at compile time check if the following macro is defined:
#define LIBNBD_HAVE_NBD_GET_TLS_NEGOTIATED 1
π SEE ALSO π
Go peek at these:
π AUTHORS π
- Eric Blake
- Richard W.M. Jones
π COPYRIGHT π
Copyright Red Hat
π LICENSE π
Legal bestie moment: hereβs the exact license text, no edits, because words matter. π«Ά
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 bye bestie π
this page is from libnbd-1.25.8, dated 2026-10-13, and the footer name is nbd_get_tls_negotiated(3) π«Ά
π¦ 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