[Mono-bugs] [Bug 377463] New: SmtpClient + EnableSsl causes RemoteCertificateChainErrors exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Apr 4 22:16:49 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=377463


           Summary: SmtpClient + EnableSsl causes
                    RemoteCertificateChainErrors exception
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: i386
        OS/Version: Debian Woody
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: shaman at shamanserv.nl
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


the code below keeps causing a RemoteCertificateChainErrors exception, various
suggested workarounds (ServicePointManager.CertificatePolicy for one) failed as
well.


-----------------

using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Mail;
using System.Security.Cryptography.X509Certificates;
using System.Net;
using System.Net.Security;

namespace TestSpace
{
    public class test
    {
        static void Main(string[] args)
        {
            SmtpClient client = new SmtpClient();
            NetworkCredential nc = new NetworkCredential();
            nc.UserName = "emailaddress at gmail.com";
            nc.Password = "password";

            client.Credentials = nc;

            client.Host = "smtp.gmail.com";
            client.Port = 587;
            client.EnableSsl = true;
            client.Timeout = 5000; // gmail tends to be slow at times, only to
prevent it from hanging the app.


            MailMessage msg = new MailMessage();
            MailAddress to = new MailAddress("to at to.com", "to");
            MailAddress from = new MailAddress("from at from.com", "from");
            msg.To.Add(to);
            msg.From = from;
            msg.Body = "test 1 2 3";
            msg.ReplyTo = from;
            client.Send(msg);


        }
    }
}


------------

I attempted at verifying the existance of the trust through certmgr, but that
is only set


-- 
Configure bugmail: https://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