]> www.infradead.org Git - users/dwmw2/openconnect.git/commit
Canonicalise hostname during authentication if necessary
authorDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 4 Feb 2013 15:57:35 +0000 (15:57 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 4 Feb 2013 15:57:35 +0000 (15:57 +0000)
commitb0b4b34f5b3b397db1558c7c2c0b358db07c9964
tree0ab4480c5b866d26be2fb2524443441e27843349
parentc86d7e0d85e4474e04a9ea95f6064f4ffd9d2204
Canonicalise hostname during authentication if necessary

Some people have round-robin servers, all addressed by the same hostname
but with different SSL certificates. Where we do the authentication (and
user-interactive approval of certificates) from a GUI via libopenconnect,
or with 'openconnect --authenticate', we end up being given the SHA1 on
the server's certificate and the non-interactive connection is going to
expect to see exactly that certificate. So if there is more than one
result in the original DNS lookup, *change* vpninfo->hostname to hold
the IP address that we actually connected to.

This means that the Host: header in what we send will be the numeric IP
address instead of the hostname, but that doesn't seem to hurt. It could
potentially, theoretically, break virtual hosts but I don't think that
kind of setup could ever existing in practice.

This also works only in the case where we're *not* connecting via a proxy.
We currently let the proxy do the DNS lookups *for* us, and we'd have to
do them locally and then ask the proxy for a connection by IP address
even for the *first* connection.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
ssl.c