Skip to content

Commit

Permalink
Make certificate expiry warning time variable (still default 60 days)
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 29, 2011
1 parent aafaa23 commit bd28802
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions library.c
Expand Up @@ -35,6 +35,7 @@ struct openconnect_info *openconnect_vpninfo_new_with_cbdata (char *useragent,

vpninfo->mtu = 1406;
vpninfo->ssl_fd = -1;
vpninfo->cert_expire_warning = 60 * 86400;
vpninfo->useragent = openconnect_create_useragent (useragent);
vpninfo->validate_peer_cert = validate_peer_cert;
vpninfo->write_new_config = write_new_config;
Expand Down
1 change: 1 addition & 0 deletions main.c
Expand Up @@ -262,6 +262,7 @@ int main(int argc, char **argv)
vpninfo->uid_csd_given = 0;
vpninfo->validate_peer_cert = validate_peer_cert;
vpninfo->cbdata = vpninfo;
vpninfo->cert_expire_warning = 60 * 86400;

if (!uname(&utsbuf))
vpninfo->localname = utsbuf.nodename;
Expand Down
1 change: 1 addition & 0 deletions openconnect-internal.h
Expand Up @@ -114,6 +114,7 @@ struct openconnect_info {
char *hostname;
int port;
char *urlpath;
int cert_expire_warning;
const char *cert;
const char *sslkey;
X509 *cert_x509;
Expand Down
2 changes: 1 addition & 1 deletion ssl.c
Expand Up @@ -831,7 +831,7 @@ static int check_certificate_expiry(struct openconnect_info *vpninfo)
} else if (i < 0) {
reason = _("Client certificate has expired at");
} else {
t += 60 * 86400;
t += vpninfo->cert_expire_warning;
i = X509_cmp_time(notAfter, &t);
if (i < 0) {
reason = _("Client certificate expires soon at");
Expand Down

0 comments on commit bd28802

Please sign in to comment.