[PATCH 3/3] Use the host's FQDN in the VNC connection



If we're using X.509 encryption then the hostname we're connecting to
must exactly match the hostname in the certificate.  As the certificate
generally contains the fqdn of the host then we convert whatever the
user supplies to the fqdn before attempting to connect.
---
 examples/gvncviewer.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/examples/gvncviewer.py b/examples/gvncviewer.py
index 9a74268..c7209ab 100644
--- a/examples/gvncviewer.py
+++ b/examples/gvncviewer.py
@@ -21,6 +21,7 @@
 import gtk
 import gtkvnc
 import sys
+import socket
 
 if len(sys.argv) != 2 and len(sys.argv) != 3:
     print "syntax: gvncviewer.py host:display [password]"
@@ -185,6 +186,7 @@ if disp != -1:
 else:
     host = sys.argv[1]
     port = "5900"
+host = socket.getfqdn(host)
 print "Connecting to %s %s" % (host, port)
 
 vnc.open_host(host, port)
-- 
1.6.2.5



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