Invalid certificate received from server. Error code: 0xffffffff800b010a Mono

﹥>﹥吖頭↗ 提交于 2019-12-10 19:46:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!