问题
I'm trying to send a message in Mono througth my application using the port 587 with the SSL, smtp.gmail.com and get:
System.Net.Mail.SmtpException: Message could not be sent. ---> 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. Error code: 0xffffffff800b010a
The most interesting is that that week everything worked and the messages were sent. Now I get a mistake.
Also I tryed mozroots --import
but it doesnt help. Also I updated certificate GoogleInternetAuthorityG2.crt but and this doesnt help.
Ubuntu 16.04 with Mono 4.6.2 (Stable 4.6.2.7/08fd525)
回答1:
Mono 4.8 or higher brings a new TLS stack that supports many more encryption algorithms, please upgrade.
回答2:
Try this before sending the message (It is kind of a hack, but on Mono this is the only thing that worked for me..)
ServicePointManager.ServerCertificateValidationCallback =
delegate(object s, X509Certificate certificate,
X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
来源:https://stackoverflow.com/questions/43543273/invalid-certificate-received-from-server-error-code-0xffffffff800b010a-mono