.\" Automatically generated by Podwrapper::Man 1.24.1 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "nbdkit-tls 1" .TH nbdkit-tls 1 "2021-01-20" "nbdkit-1.24.1" "NBDKIT" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" nbdkit\-tls \- authentication and encryption of NBD connections (sometimes incorrectly called "SSL") .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& nbdkit [\-\-tls=off|on|require] [\-\-tls\-certificates /path/to/certificates] \& [\-\-tls\-psk /path/to/pskfile] [\-\-tls\-verify\-peer] \& PLUGIN [...] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1TLS\s0 (authentication and encryption, sometimes incorrectly called \&\*(L"\s-1SSL\*(R"\s0) is supported if nbdkit was compiled with GnuTLS. This allows the server to verify that the client is allowed access, and to encrypt the contents of the protocol in transit over the network. .PP \&\s-1TLS\s0 can be disabled or enabled by specifying either \fI\-\-tls=off\fR or \&\fI\-\-tls=on\fR. With \fI\-\-tls=off\fR, if a client tries to use \s-1TLS\s0 to connect, it will be rejected by the server (in other words, as if the server doesn't support \s-1TLS\s0). .PP \&\fI\-\-tls=on\fR means that the client may choose to connect either with or without \s-1TLS.\s0 In this mode, a plugin may wish to serve different content depending on whether the client has authenticated; the function \f(CW\*(C`nbdkit_is_tls()\*(C'\fR can be used during the \f(CW\*(C`.open\*(C'\fR callback for that purpose. Or, you can opt to use \&\fBnbdkit\-tls\-fallback\-filter\fR\|(1) to provide safe fallback content to plaintext connections, saving the plugin content only for secure connections. .PP Because \fI\-\-tls=on\fR is subject to downgrade attacks where a malicious proxy pretends not to support \s-1TLS\s0 in order to force either the client or server to communicate in plaintext, you can also specify \&\fI\-\-tls=require\fR, where the server enables \s-1TLS\s0 \fBand\fR rejects all non-TLS connection attempts. .SS "\s-1TLS\s0 with X.509 certificates" .IX Subsection "TLS with X.509 certificates" When nbdkit starts up, it loads \s-1TLS\s0 certificates from some built-in paths, or from the directory specified by the \fI\-\-tls\-certificates\fR option. .PP Without \fI\-\-tls\-certificates\fR, if nbdkit is started as a non-root user (note this does not include use of the \fI\-u\fR or \fI\-g\fR options), nbdkit looks in each of these paths in turn: .PP .Vb 2 \& $HOME/.pki/nbdkit/ \& $HOME/.config/pki/nbdkit/ .Ve .PP Without \fI\-\-tls\-certificates\fR, if nbdkit is started as root, nbkit looks in: .PP .Vb 1 \& $sysconfdir/pki/nbdkit/ .Ve .PP (Use \f(CW\*(C`nbdkit \-\-dump\-config\*(C'\fR and look at the \&\f(CW\*(C`root_tls_certificates_dir\*(C'\fR setting to get the actual directory built into the binary.) .PP You can override both directories above by using \&\fI\-\-tls\-certificates /path/to/certificates\fR. .PP In this directory, nbdkit expects to find several files: .IP "\fIca\-cert.pem\fR" 4 .IX Item "ca-cert.pem" The Certificate Authority certificate. .IP "\fIserver\-cert.pem\fR" 4 .IX Item "server-cert.pem" The server certificate. .IP "\fIserver\-key.pem\fR" 4 .IX Item "server-key.pem" The server private key. .IP "\fIca\-crl.pem\fR" 4 .IX Item "ca-crl.pem" (Optional) The certificate revocation list. .PP \fISetting up the Certificate Authority\fR .IX Subsection "Setting up the Certificate Authority" .PP This step only needs to be done once per organization. It may be that your organization already has a \s-1CA.\s0 .PP .Vb 2 \& $ certtool \-\-generate\-privkey > ca\-key.pem \& $ chmod 0600 ca\-key.pem .Ve .PP The \fIca\-key.pem\fR file is the \s-1CA\s0 private key and is \fIextremely\fR sensitive data. With possession of this key, anyone can create certificates pretending to be your organization! .PP To create the \s-1CA\s0 certificate file: .PP .Vb 9 \& $ cat > ca.info < server\-key.pem \& $ chmod 0600 server\-key.pem .Ve .PP The server key file is sensitive. Setting the mode to \f(CW0600\fR helps to prevent other users on the same machine from reading it. .PP The server \s-1DNS\s0 name (\f(CW\*(C`cn\*(C'\fR below) must be the fully qualified hostname — and the only hostname — that the client connects to. .PP .Vb 10 \& $ cat > server.info < client\-key.pem \& $ chmod 0600 client\-key.pem .Ve .PP The client key file is sensitive. .PP The client \s-1DNS\s0 name (\f(CW\*(C`cn\*(C'\fR below) is the client's name that nbdkit sees and checks. .PP .Vb 10 \& $ cat > client.info <