nbdkit_is_tls - Man Page

get TLS status of the connection for nbdkit

Synopsis

 #include <nbdkit-plugin.h>

 int nbdkit_is_tls (void);

Description

nbdkit_is_tls returns true if and only if TLS negotiation has been completed on the current connection.  An nbdkit(1) plugin may use nbdkit_is_tls to limit connections according to whether the client connection is protected by TLS.  This function uses thread-local magic so no parameter is required

nbdkit-tls-fallback-filter(1) and the nbdkit --tls=require option are other alternatives.

Return Value

The function returns 1 (true) if TLS negotiation has been completed, or 0 (false) if not.

If there is an error it calls nbdkit_error(3) and returns -1.

Language Bindings

In nbdkit-ocaml-plugin(3):

 NBDKit.is_tls : unit -> bool

In nbdkit-python-plugin(3):

 import nbdkit
 tls = nbdkit.is_tls()

In nbdkit-rust-plugin(3):

 use nbdkit::*;
 pub fn is_tls() -> Result<bool>

In nbdkit-sh-plugin(3) the TLS flag is available as parameter $4 of the open method.

History

nbdkit_is_tls was added in nbdkit 1.22.

See Also

nbdkit(1), nbdkit_export_name(3), nbdkit-plugin(3), nbdkit-filter(3), nbdkit-tls(1), nbdkit-tls-fallback-filter(1).

Authors

Eric Blake

License

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Referenced By

NBDKit(3), nbdkit_export_name(3), nbdkit-filter(3), nbdkit_peer_tls_dn(3), nbdkit-plugin(3), nbdkit-tls(1).

2024-10-14 nbdkit-1.41.8