summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2011-02-01 15:06:03 +0000
committerAdam Tkac <atkac@redhat.com>2011-02-01 15:06:03 +0000
commit0b4287185bfb4acf53ca9de35f4de80a42b2bbfa (patch)
treefe43c0122751c0fbef588f2165aa2a7b4f3be550
parent670a09cf42ce4fd958e1ab3f790096c8068b820e (diff)
downloadtigervnc-0b4287185bfb4acf53ca9de35f4de80a42b2bbfa.tar.gz
tigervnc-0b4287185bfb4acf53ca9de35f4de80a42b2bbfa.zip
[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
-rw-r--r--unix/vncviewer/CConn.cxx2
-rw-r--r--win/vncviewer/CConn.cxx3
2 files changed, 3 insertions, 2 deletions
diff --git a/unix/vncviewer/CConn.cxx b/unix/vncviewer/CConn.cxx
index 7983cdfc..f93a3d60 100644
--- a/unix/vncviewer/CConn.cxx
+++ b/unix/vncviewer/CConn.cxx
@@ -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();
}
diff --git a/win/vncviewer/CConn.cxx b/win/vncviewer/CConn.cxx
index b34b56eb..3585966e 100644
--- a/win/vncviewer/CConn.cxx
+++ b/win/vncviewer/CConn.cxx
@@ -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());