[PATCH] remote: Switch to TLS when connecting to remote socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If users wants to connect to remote unix socket, e.g.
'qemu+unix://<remote>/system' currently the <remote> part is ignored,
ending up connecting to localhost. This patch solves this issue by
creating TLS connection.
---
 src/remote/remote_driver.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index e5bfa4b..630c8ea 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -325,9 +325,14 @@ doRemoteOpen (virConnectPtr conn,
             } else {
                 if (STRCASEEQ (transport_str, "tls"))
                     transport = trans_tls;
-                else if (STRCASEEQ (transport_str, "unix"))
-                    transport = trans_unix;
-                else if (STRCASEEQ (transport_str, "ssh"))
+                else if (STRCASEEQ (transport_str, "unix")) {
+                    /* When connecting to unix socket on remote
+                     * machine use TLS to connect to it */
+                    if (conn->uri->server)
+                        transport = trans_tls;
+                    else
+                        transport = trans_unix;
+                } else if (STRCASEEQ (transport_str, "ssh"))
                     transport = trans_ssh;
                 else if (STRCASEEQ (transport_str, "ext"))
                     transport = trans_ext;
-- 
1.7.3.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]