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: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          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("[email protected]", "Sender");
            var to = new MailAddress("[email protected]");
            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("[email protected]",
"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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to