Fixed date mangling for certificate expiry check.