mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Fix cert expiration for dates after year 2049
This commit is contained in:
parent
6860279094
commit
eba5cb9dc9
@ -704,11 +704,11 @@ class OpenSSLIOHook : public SSLIOHook
|
||||
certinfo->activation = GetTime(X509_getm_notBefore(cert));
|
||||
certinfo->expiration = GetTime(X509_getm_notAfter(cert));
|
||||
|
||||
int activated = ASN1_UTCTIME_cmp_time_t(X509_getm_notBefore(cert), ServerInstance->Time());
|
||||
int activated = ASN1_TIME_cmp_time_t(X509_getm_notBefore(cert), ServerInstance->Time());
|
||||
if (activated != -1 && activated != 0)
|
||||
certinfo->error = "Certificate not activated";
|
||||
|
||||
int expired = ASN1_UTCTIME_cmp_time_t(X509_getm_notAfter(cert), ServerInstance->Time());
|
||||
int expired = ASN1_TIME_cmp_time_t(X509_getm_notAfter(cert), ServerInstance->Time());
|
||||
if (expired != 0 && expired != 1)
|
||||
certinfo->error = "Certificate has expired";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user