nbdkit_is_tls(3)

✨ nbdkit_is_tls ✨

okay bestie, gather round, because this is the little function that tells you whether your connection is wearing its ✨TLS✨ armor or just rolling in with vibes only. it lives in nbdkit, manual section 3, and it's genuinely so useful i'm obsessed 🫢


🌸 NAME 🌸

nbdkit_is_tls β€” get the TLS status of the connection for nbdkit πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <nbdkit-plugin.h>

int nbdkit_is_tls (void);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so nbdkit_is_tls returns true if and only if TLS negotiation has been completed on the current connection. that's it. that's the whole job. icon behavior, honestly πŸ‘‘

an nbdkit(1) plugin can use nbdkit_is_tls to limit connections according to whether the client connection is protected by TLS β€” like, "bestie you may only talk to me if you're encrypted" energy πŸ”

and the way this function works? it uses thread-local magic, so no parameter is required. no cap. it just knows 🧚

also, for the record: nbdkit-tls-fallback-filter(1) and the nbdkit --tls=require option are other alternatives. so you've got options, queen 🌈


πŸ’– RETURN VALUE πŸ’–

  • the function returns 1 (true) if TLS negotiation has been completed 🌸
  • or 0 (false) if not πŸ™ˆ
but listen β€” if there's an error, it calls nbdkit_error(3) and returns -1. so like, check for that, fr fr πŸ’€

🌈 LANGUAGE BINDINGS 🌈

everybody gets a turn, and that's on inclusivity ✨

πŸ’œ nbdkit-ocaml-plugin(3)

NBDKit.is_tls : unit -> bool

πŸ“ nbdkit-python-plugin(3)

import nbdkit
tls = nbdkit.is_tls()

⭐ nbdkit-rust-plugin(3)

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

πŸŽ€ nbdkit-sh-plugin(3)

in nbdkit-sh-plugin(3) the TLS flag is available as parameter $4 of the "open" method. yes, $4. not $1. don't do that to yourself 😭


πŸ‘‘ HISTORY πŸ‘‘

nbdkit_is_tls was added in nbdkit 1.22. a classic. an era. we love her πŸ’…


🌸 SEE ALSO 🌸


🫢 AUTHORS 🫢

Eric Blake β€” thank you for your service, legend 🫑


Copyright Red Hat


πŸ“œ LICENSE πŸ“œ

bestie this part is the serious part, so i'm keeping every single word exactly as written β€” no edits, no vibes, just the legal text πŸŽ€

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

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.


okay that's the whole page!! this one's from nbdkit-1.48.1, dated 2026-08-29 β€” go forth and check your TLS status, main character πŸŒŸπŸ’– bye bestie!!

πŸ“¦ where this page comes from