'How Can I Force .Net Core To Send Email Using Expired Certificate?

My ASP.Net Core website won't send email due to an error on the email server. The error appears to be due to AutoSSL issuing certificates that already expired at midnight every day. I use a separate cPanel server for all email.

I am trying to get cPanel to fix this by posting a gripe calling them out on their forum, but until then is there a way to tell .Net Core to ignore the error and send mail anyway?

The exact error messages from my Razor pages is "A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file." How do I tell my site to send mail regardless of the status of this certificate?

I can still send mail using that server via Outlook just fine, so there must be a way to achieve the same thing using Razor pages.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source