[Mono-bugs] [Bug 620960] New: SSL cert issue when sending email from system account.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jul 8 14:50:03 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=620960

http://bugzilla.novell.com/show_bug.cgi?id=620960#c0


           Summary: SSL cert issue when sending email from system account.
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: abe.gillespie at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US)
AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

Put this in a webform and run it under Apache (do not run XSP from the command
line):

    public partial class TestEmail : System.Web.UI.Page
    {
        protected void Send(object sender, EventArgs args)
        {
            var from = new MailAddress("sender at gmail.com", "Sender");
            var to = new MailAddress("receiver at gmail.com");
            var mail = new MailMessage(from, to)
            {
                Subject = "Test Mail",
                IsBodyHtml = true,
                Body = "Please let this work!"
            };

            var smtp = new SmtpClient("smtp.gmail.com", 587)
            {
                EnableSsl = true,
                Credentials = new NetworkCredential("sender at gmail.com",
"p4ssw0rd")
            };

            smtp.Send(mail);
        }
    }

You'll get this exception:

System.InvalidOperationException: SSL authentication error:
RemoteCertificateNotAvailable
  at System.Net.Mail.SmtpClient.<callback>m__4 (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__A
(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 

Note that mozroots and certmgr have been run with the "-m" flag and should be
OK to the best of my knowledge.  Sending mail running a console app from the
command line works fine.  It's something with the system account / SSL store.

Reproducible: Always

Steps to Reproduce:
See description.
Actual Results:  
Boom!

Expected Results:  
Successfully sent email.

I like elephants.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list