Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add --cert-expire-warning,-e option to set warning level
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 29, 2011
1 parent bd28802 commit 7ebcc26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.c
Expand Up @@ -98,6 +98,7 @@ static struct option long_options[] = {
{"cookie", 1, 0, 'C'},
{"deflate", 0, 0, 'd'},
{"no-deflate", 0, 0, 'D'},
{"cert-expire-warning", 1, 0, 'e'},
{"usergroup", 1, 0, 'g'},
{"help", 0, 0, 'h'},
{"interface", 1, 0, 'i'},
Expand Down Expand Up @@ -147,6 +148,7 @@ static void usage(void)
printf(" -b, --background Continue in background after startup\n");
printf(" --pid-file=PIDFILE Write the daemons pid to this file\n");
printf(" -c, --certificate=CERT Use SSL client certificate CERT\n");
printf(" -e, --cert-expire-warning=DAYS Warn when certificate lifetime < DAYS\n");
printf(" -k, --sslkey=KEY Use SSL private key file KEY\n");
printf(" -K, --key-type=TYPE Private key type (PKCS#12 / TPM / PEM)\n");
printf(" -C, --cookie=COOKIE Use WebVPN cookie COOKIE\n");
Expand Down Expand Up @@ -269,7 +271,7 @@ int main(int argc, char **argv)
else
vpninfo->localname = "localhost";

while ((opt = getopt_long(argc, argv, "bC:c:Ddg:hi:k:K:lpP:Q:qSs:U:u:Vvx:",
while ((opt = getopt_long(argc, argv, "bC:c:e:Ddg:hi:k:K:lpP:Q:qSs:U:u:Vvx:",
long_options, NULL))) {
if (opt < 0)
break;
Expand Down Expand Up @@ -328,6 +330,9 @@ int main(int argc, char **argv)
case 'c':
vpninfo->cert = optarg;
break;
case 'e':
vpninfo->cert_expire_warning = 86400 * atoi(optarg);
break;
case 'k':
vpninfo->sslkey = optarg;
break;
Expand Down
9 changes: 9 additions & 0 deletions openconnect.8
Expand Up @@ -15,6 +15,10 @@ openconnect \- Connect to Cisco AnyConnect VPN
.I CERT
]
[
.B -e,--cert-expire-warning
.I DAYS
]
[
.B -k,--sslkey
.I KEY
]
Expand Down Expand Up @@ -201,6 +205,11 @@ when backgrounding
Use SSL client certificate
.I CERT
.TP
.B -e,--cert-expire-warning=DAYS
Give a warning when SSL client certificate has
.I DAYS
left before expiry
.TP
.B -k,--sslkey=KEY
Use SSL private key file
.I KEY
Expand Down

0 comments on commit 7ebcc26

Please sign in to comment.