block/nbd: support override of hostname for TLS certificate validation
commita0cd6d297283bedffafce939dce38f3d06f3e2cd
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 4 Mar 2022 19:36:01 +0000 (4 19:36 +0000)
committerEric Blake <eblake@redhat.com>
Mon, 7 Mar 2022 21:58:42 +0000 (7 15:58 -0600)
tree5dbf9afbef43551e5928944e86987f1cec4854b6
parent046f98d0753872b1e3189689da16c68e1f6c78c2
block/nbd: support override of hostname for TLS certificate validation

When connecting to an NBD server with TLS and x509 credentials,
the client must validate the hostname it uses for the connection,
against that published in the server's certificate. If the client
is tunnelling its connection over some other channel, however, the
hostname it uses may not match the info reported in the server's
certificate. In such a case, the user needs to explicitly set an
override for the hostname to use for certificate validation.

This is achieved by adding a 'tls-hostname' property to the NBD
block driver.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220304193610.3293146-4-berrange@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
block/nbd.c
qapi/block-core.json