All of the sudden, cannot connect to IMAP server from Nextcloud

My Nextcloud instance has worked fine for email for over a year. Out of nowhere today it started rejecting connection to the IMAP server via the Mail app and the Snappymail app. I’m running NC 27.1.3 with PHP 8.1.2. I’ve not updated anything recently on either the Email server (in house dovecot) or the Nextcloud server.
Here is the error I see trying to test the connection in SnappyMail:
stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:0A000086:SSL routines::certificate verify failed

As far as I can tell the certs on the mail server are up to date as well. I can connect to the roundcube server locally on the email server and it operates fine. Also I have a mobile app talking to IMAP just fine. Anyone know what might cause this or how I can troubleshoot further?

Check the IMAP server’s mail log.