]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
properly handle alternate GPST tunnel path
authorDaniel Lenski <dlenski@gmail.com>
Sat, 13 Jan 2018 02:18:06 +0000 (18:18 -0800)
committerDavid Woodhouse <dwmw2@infradead.org>
Tue, 27 Feb 2018 15:28:32 +0000 (16:28 +0100)
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
gpst.c

diff --git a/gpst.c b/gpst.c
index 306d67942e2ead0f916607372dcf2dd73fb66f3c..6ce4ef1c926371a0d8409491f43c023cd5d560dc 100644 (file)
--- a/gpst.c
+++ b/gpst.c
@@ -447,6 +447,11 @@ static int gpst_parse_config_xml(struct openconnect_info *vpninfo, xmlNode *xml_
                else if (!xmlnode_get_text(xml_node, "mtu", &s)) {
                        vpninfo->ip_info.mtu = atoi(s);
                        free(s);
+               } else if (!xmlnode_get_text(xml_node, "ssl-tunnel-url", &s)) {
+                       free(vpninfo->urlpath);
+                       vpninfo->urlpath = s;
+                       if (strcmp(s, "/ssl-tunnel-connect.sslvpn"))
+                               vpn_progress(vpninfo, PRG_INFO, _("Non-standard SSL tunnel path: %s\n"), s);
                } else if (!xmlnode_get_text(xml_node, "timeout", &s)) {
                        int sec = atoi(s);
                        vpn_progress(vpninfo, PRG_INFO, _("Tunnel timeout (rekey interval) is %d minutes.\n"), sec/60);
@@ -626,7 +631,7 @@ static int gpst_connect(struct openconnect_info *vpninfo)
                return ret;
 
        reqbuf = buf_alloc();
-       buf_append(reqbuf, "GET /ssl-tunnel-connect.sslvpn?");
+       buf_append(reqbuf, "GET %s?", vpninfo->urlpath);
        filter_opts(reqbuf, vpninfo->cookie, "user,authcookie", 1);
        buf_append(reqbuf, " HTTP/1.1\r\n\r\n");