The IMAP server I connect to is called imap.example.com and has a wildcard TLS certificate (*.example.com).
When I try to use this server, isync reports this error:
Error, certificate owner does not match hostname imap.example.com
I guess it is because imap.example.com is not exactly found in the certificate.
I have found no workaround. I tried to download the cert (and full cert chain) and provide it via CertificateFile. I added SystemCertificates no. I then get this error instead:
SSL error connecting imap.example.com (192.0.2.123:993): unable to get local issuer certificate