Skip to content

Commit

Permalink
Select User-Agent field
Browse files Browse the repository at this point in the history
Cisco device logs User-Agent: string, as explained in
http://www.cisco.com/en/US/docs/security/vpn_client/anyconnect/anyconnect23/release/notes/anyconnect23rn.html#wp908512
This patch let you change OpenConnect default User-Agent: string from
command line.

e.g. --useragent 'Cisco AnyConnect VPN Agent for Windows 2.2.0133'

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
borneoa authored and David Woodhouse committed Aug 4, 2009
1 parent 028c5f8 commit bc89952
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.c
Expand Up @@ -84,6 +84,7 @@ static struct option long_options[] = {
{"authgroup", 1, 0, '9'},
{"servercert", 1, 0, 0x01},
{"key-password-from-fsid", 0, 0, 0x02},
{"useragent", 1, 0, 0x03},
{NULL, 0, 0, 0},
};

Expand Down Expand Up @@ -125,6 +126,7 @@ void usage(void)
printf(" --passwd-on-stdin Read password from standard input\n");
printf(" --reconnect-timeout Connection retry timeout in seconds\n");
printf(" --servercert Server's certificate SHA1 fingerprint\n");
printf(" --useragent=STRING HTTP header User-Agent: field\n");
exit(1);
}

Expand Down Expand Up @@ -326,6 +328,10 @@ int main(int argc, char **argv)
case 0x02:
do_passphrase_from_fsid = 1;
break;
case 0x03:
free(vpninfo->useragent);
vpninfo->useragent = optarg;
break;
default:
usage();
}
Expand Down
8 changes: 8 additions & 0 deletions openconnect.8
Expand Up @@ -129,6 +129,10 @@ openconnect \- Connect to Cisco AnyConnect VPN
.B --servercert
.I FINGERPRINT
]
[
.B --useragent
.I STRING
]
\fIserver\fR

.SH DESCRIPTION
Expand Down Expand Up @@ -274,6 +278,10 @@ VPN connection after a temporary network down time of 300 seconds.
.TP
.B --servercert
Accept server's SSL certificate only if its SHA1 fingerprint matches.
.TP
.B --useragent=STRING
Use STRING as 'User-Agent:' field value in HTTP header.
(e.g. --useragent 'Cisco AnyConnect VPN Agent for Windows 2.2.0133')

.SH LIMITATIONS
The
Expand Down

0 comments on commit bc89952

Please sign in to comment.