We are getting the following error in action mailer in Rails 6.1:
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)
The strange thing is that this error is not reproducible all the time. The error does not happen in rails console or with openssl client test against the mail server's domain. It only happens with the rails web app and after sometime the app has started. Each time the app is restarted, the error goes away for sometime.