]> source.dussan.org Git - tigervnc.git/commitdiff
[Bugfix] viewers: set server's hostname as a server name. (Thanks to Guillaume Destuy...
authorAdam Tkac <atkac@redhat.com>
Tue, 1 Feb 2011 15:06:03 +0000 (15:06 +0000)
committerAdam Tkac <atkac@redhat.com>
Tue, 1 Feb 2011 15:06:03 +0000 (15:06 +0000)
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

unix/vncviewer/CConn.cxx
win/vncviewer/CConn.cxx

index 7983cdfc2f7a9a4e154ec1a9671a6716b3117f35..f93a3d60da1294771395b350c6d39a8da5db298e 100644 (file)
@@ -116,7 +116,7 @@ CConn::CConn(Display* dpy_, int argc_, char** argv_, network::Socket* sock_,
 
   sameMachine = sock->sameMachine();
   sock->inStream().setBlockCallback(this);
-  setServerName(sock->getPeerEndpoint());
+  setServerName(serverHost);
   setStreams(&sock->inStream(), &sock->outStream());
   initialiseProtocol();
 }
index b34b56eba316ce6e4071a9c7b913fe334bfd1b47..3585966ee0f7a233fef7531dac0decfa4515fdb3 100644 (file)
@@ -90,9 +90,10 @@ CConn::~CConn() {
 bool CConn::initialise(network::Socket* s, bool reverse) {
   // Set the server's name for MRU purposes
   CharArray endpoint(s->getPeerEndpoint());
-  setServerName(endpoint.buf);
+
   if (!options.host.buf)
     options.setHost(endpoint.buf);
+  setServerName(options.host.buf);
 
   // Initialise the underlying CConnection
   setStreams(&s->inStream(), &s->outStream());