SendMail invalid certificate

I am trying to set up email notifications. I am using the CLI to (try to) send test emails. I am getting a TLS certificate error from Mono. Googling suggests running mozroots --import --ask-remove, which I have done from both user and root, yet I am still getting the certificate error. Suggestions?

duplicati-cli send-mail --verbose --log-level=profiling --send-mail-to=<redacted> --send-mail-from=<redacted> --send-mail-url=smtps://smtp.fastmail.com:465 --send-mail-username=<redacted> --send-mail-password=<redacted>
Input command: send-mail
Input arguments: 

Input options: 
verbose: 
log-level: profiling
send-mail-to: <redacted>
send-mail-from: <redacted>
send-mail-url: smtps://smtp.fastmail.com:465
send-mail-username: <redacted>
send-mail-password: <redacted>

Starting - Running SendMail
Running SendMail took 00:00:00.007
Failed to send email: System.IO.IOException: The authentication or decryption has failed.
--> System.IO.IOException: The authentication or decryption has failed.
--> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server.
 => The authentication or decryption has failed.

OpenSSL had no trouble verifying the certificate.

I “fixed” it by running

certmgr -ssl smtps://smtp.fastmail.com:465

and accepting the root certificate into the CA store and accepting the server certificate into the AddressBook store.

1 Like

Hi @Tywin, welcome to the forum and thanks for sharing your solution!

This issue with mono certificates is an ongoing one that we haven’t quite managed to find a good workaround for, but hopefully your post can help the next person who runs into this.