Log4net
  1. Log4net
  2. LOG4NET-315

SmtpAppender - Add support for ignoring certificate errors

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.11
    • Fix Version/s: 1.2.12
    • Component/s: Appenders
    • Labels:
      None

      Description

      As of 1.2.11 the SmtpAppender now has support for enabling smtp connections to use SSL. It is pretty common to have an SMTP server that is using a Self-Signed certificate which will fail the certificate validation. While you can override the certificate error on an application level to overcome this you might want to limit the ignoring of the certificate error just to the appender.

      Proposed Changes

      Add property that allows one to indicate they wish to ignore certificate failures.
      DisableCertificateValidation

      Add a line like this to SendBuffer method

      ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);

      Then create a call back method like so

      private bool ValidateRemoteCertificate(object sender,
      X509Certificate certificate,
      X509Chain chain,
      SslPolicyErrors policyErrors)

      { if(DisableCertificateValidation) return true; return policyErrors == null; }

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Jim Scott
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 2h
              2h
              Remaining:
              Remaining Estimate - 2h
              2h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development