nbd_set_uri_allow_tls_priority3
Set if 'tls-priority' is allowed in nbd uris
Usage
#include <libnbd.h>int nbd_set_uri_allow_tls_priority (struct nbd_handle *h, bool allow);
Overview
Allow NBD URIs to override the TLS priority using "?tls-priority=PRIORITY" in the query string.
This is disabled by default because it is probably not safe. The TLS priority string is quite powerful, allowing you to read some local configuration files, and possibly to downgrade TLS security.
Return value
If the call is successful the function returns 0.
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).
Handle state
nbd_set_uri_allow_tls_priority 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 │└─────────────────────────────────────┴─────────────────────────┘
Version
This function first appeared in libnbd 1.24.
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_PRIORITY 1