Error adding coremail account: X509_verify_cert_error_string: unable to get local issuer certificate

When trying to add a coremail account to mailspring using imap protocol, I got the following error log:

OpenSSL version: OpenSSL 1.1.0f 25 May 2017

Verification failed:

X509_verify_cert_error_string:

unable to get local issuer certificate

X509_get_subject_name:

ssl connect certificate ERROR 2

My OS: Ubuntu 22.04.1
Mailspring version 1.10.8-8ea2a61f
Installed from Ubuntu’s app store.