]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix reporting of TLS connection errors
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 17 Dec 2009 17:39:43 +0000 (17:39 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 21 Dec 2009 12:18:38 +0000 (12:18 +0000)
commit469b6b3a75bf0a4bfc9b9fd7ad2ce5ebe0105699
treeea8dd3cc3eafc5f19a87296f752ed3c69e0b3f61
parent9b2c299a359c0415c431767ef49dfdf1a575a76f
Fix reporting of TLS connection errors

The code for connecting to a server tries each socket in turn
until it finds one that connects. Unfortunately for TLS sockets
if it connected, but failed TLS handshake it would treat that
as a failure to connect, and try the next socket. This is bad,
it should have reported the TLS failure immediately.

$ virsh -c qemu://somehost.com/system
error: unable to connect to libvirtd at 'somehost.com': Invalid argument
error: failed to connect to the hypervisor

$ ./tools/virsh -c qemu://somehost.com/system
error: server certificate failed validation: The certificate hasn't got a known issuer.
error: failed to connect to the hypervisor

 * src/remote/remote_driver.c: Stop trying to connect if the
   TLS handshake fails
src/remote/remote_driver.c