When a program using openssl library is using a certificate, does the server check if the issuer(s) are still valid If I have a program acting as TLS server with a certificate signed by a CA, if one of the issuers in the chain becomes invalidated or the date expires, then how does the program using the certificate know this?  Or is it up to the client to do this checking?

My specific scenario is self-signed root CA signs server certificate.
The server may react as it pleases. The TLS spec doesn't come with application instructions in this regard.

The client should definitely reject any certificate chain it manages to build with an expired certificate. That means that the handshake should fail and the TLS session will not be instantiated. This requirement depends on a clock available to the client - which may be tricky in itself for certain environments.

It doesn't matter that the chain only consists of two certificates; root and leaf certificate.