char request_body[2048];
const char *request_body_type = "application/x-www-form-urlencoded";
const char *method = "POST";
+ char *orig_host = NULL, *orig_path = NULL;
+ int orig_port = 0;
int xmlpost = 1;
/* Step 1: Unlock software token (if applicable) */
if (result < 0)
return result;
+ orig_host = strdup(vpninfo->hostname);
+ orig_path = vpninfo->urlpath ? strdup(vpninfo->urlpath) : NULL;
+ orig_port = vpninfo->port;
+
for (tries = 0; ; tries++) {
if (tries == 3) {
fail:
request_body_type = NULL;
request_body[0] = 0;
method = "GET";
+ if (orig_host) {
+ openconnect_set_hostname(vpninfo, orig_host);
+ orig_host = NULL;
+ free(vpninfo->urlpath);
+ vpninfo->urlpath = orig_path;
+ orig_path = NULL;
+ vpninfo->port = orig_port;
+ }
openconnect_close_https(vpninfo, 0);
} else {
return -EIO;
if (xmlpost)
vpn_progress(vpninfo, PRG_INFO, _("XML POST enabled\n"));
+ free (orig_host);
+ free (orig_path);
+
/* Step 4: Run the CSD trojan, if applicable */
if (vpninfo->csd_starturl && vpninfo->csd_waiturl) {
char *form_path = NULL;
<ul>
<li><b>OpenConnect HEAD</b>
<ul>
+ <li>Use original URL when falling back to non-XML POST mode.</li>
<li>Add <tt>--no-xmlpost</tt> option to revert to older, compatible behaviour.</li>
<li>Close connection before falling back to non-xmlpost mode <a href="https://bugzilla.redhat.com/show_bug.cgi?id=964650"><i>(RH#964650)</i></a>.</li>
<li>Improve error handling when server closes connection <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708928"><i>(Debian #708928)</i></a>.</li>