There is no way to disable the expiration check of a certificate. If there is a way to accept the certificate anyway depends on the use of explicit HSTS (via Strict-Transport-Security HTTP header) or implicit HSTS (i.e. specific domains like .dev) always require HTTPS. If HSTS is used a certificate which is considered invalid cannot be accepted.
As long as you talk about software protection, there are as many ways to protect software as ways to defeat those protections.
All you can do is make it hard to break.
As svin83 commented you can indeed make sure that your software detects its running inside a VM (which obviously could be bypassed too). There are really plenty of technics to do so the ...
Is there any solution?
For there to be a complete, perfect solution, you cannot be in a situation where the licensee has full control over the whole runtime environment; for, when this happens, by definition the program can be made to run in any number of copies one desires.
Control must be taken away from the licensee, which means there need to be ...