[Bugfix] viewers: set server's hostname as a server name. (Thanks to Guillaume Destuynder)

We use the server name for hostname matching in X.509 code. Otherwise
certificate wouldn't match hostname.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4249 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/vncviewer/CConn.cxx b/unix/vncviewer/CConn.cxx
index 7983cdf..f93a3d6 100644
--- a/unix/vncviewer/CConn.cxx
+++ b/unix/vncviewer/CConn.cxx
@@ -116,7 +116,7 @@
 
   sameMachine = sock->sameMachine();
   sock->inStream().setBlockCallback(this);
-  setServerName(sock->getPeerEndpoint());
+  setServerName(serverHost);
   setStreams(&sock->inStream(), &sock->outStream());
   initialiseProtocol();
 }