[Mono-aspnet-list] SSL authentication error: RemoteCertificateNotAvailable, RemoteCertificateChainErrors

Jan van der watt janvanderwatt at gmail.com
Wed Apr 7 18:28:21 EDT 2010


Hi there,

I'm trying to send an e-mail (through my Google account) using ASP.NET on
Mono (2.6.1, openSuse 11), when I get this error:

*SSL authentication error: RemoteCertificateNotAvailable,
RemoteCertificateChainErrors*

*Description: *HTTP 500. Error processing request.

*Stack Trace: *

System.InvalidOperationException: SSL authentication error:
RemoteCertificateNotAvailable, RemoteCertificateChainErrors
  at System.Net.Mail.SmtpClient.<callback>m__3 (System.Object sender,
System.Security.Cryptography.X509Certificates.X509Certificate
certificate, System.Security.Cryptography.X509Certificates.X509Chain
chain, SslPolicyErrors sslPolicyErrors) [0x00000] in <filename
unknown>:0
  at System.Net.Security.SslStream+<BeginAuthenticateAsClient>c__AnonStorey7.<>m__9
(System.Security.Cryptography.X509Certificates.X509Certificate cert,
System.Int32[] certErrors) [0x00000] in <filename unknown>:0
  at Mono.Security.Protocol.Tls.SslClientStream.OnRemoteCertificateValidation
(System.Security.Cryptography.X509Certificates.X509Certificate
certificate, System.Int32[] errors) [0x00000] in <filename unknown>:0
  at Mono.Security.Protocol.Tls.SslStreamBase.RaiseRemoteCertificateValidation
(System.Security.Cryptography.X509Certificates.X509Certificate
certificate, System.Int32[] errors) [0x00000] in <filename unknown>:0
  at Mono.Security.Protocol.Tls.SslClientStream.RaiseServerCertificateValidation
(System.Security.Cryptography.X509Certificates.X509Certificate
certificate, System.Int32[] certificateErrors) [0x00000] in <filename
unknown>:0
  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates
(Mono.Security.X509.X509CertificateCollection certificates) [0x00000]
in <filename unknown>:0
  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1
() [0x00000] in <filename unknown>:0
  at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process ()
[0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check)
Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()
  at Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage
(Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in <filename
unknown>:0
  at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback
(IAsyncResult asyncResult) [0x00000] in <filename unknown>:0


The code is really trivial, and it does work on MS.NET.

I would really appreciate some pointers on where to start looking to resolve
this as I haven't found any relevant information by:
- searching Google (for "RemoteCertificateNotAvailable SmtpClient" and other
variations)
- reading the Mono documentation on System.Net.Mail

Here's my code snippet (some details obfuscated):

            MailMessage mail = new MailMessage(
                "info at DOMAIN.com",
                "ME at gmail.com",
                "testing mail delivery",
                "Yippee! It works!"
            );

            System.Net.NetworkCredential aCred = new
System.Net.NetworkCredential("ME at gmail.com", "password");

            SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
            smtp.EnableSsl = true;
            smtp.UseDefaultCredentials = false;
            smtp.Credentials = aCred;
            smtp.Send(mail);


Jan van der Watt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20100408/b85930b9/attachment.html 


More information about the Mono-aspnet-list mailing list