You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However some components of the default function (IsUntrustedRoot and IsKnownMailServerCertificate) which would / could be repeated verbatim cannot be reused due to being private / internal.
Our current approach uses a custom subclass of SmtpClient and needs of the two the logic in IsUntrustedRoot, which is short enough to copy and adapt which however means replicating something that already exists in the library. We do not need IsKnownMailServerCertificate, and were us (or others) to need it it would be considerably more unwieldy to repeat.
I lack the experience to properly evaluate which of the many other components could be useful to subclasses, but I feel at least the two I noticed could be exposed.
The text was updated successfully, but these errors were encountered:
There is a dedicated way to make a
SmtpClient
use a custom certificate validation callback:https://mimekit.net/docs/html/P_MailKit_MailService_ServerCertificateValidationCallback.htm
It is easy enough to implement a custom logic using the default as a model:
MailKit/MailKit/MailService.cs
Line 545 in 449d58a
However some components of the default function (
IsUntrustedRoot
andIsKnownMailServerCertificate
) which would / could be repeated verbatim cannot be reused due to being private / internal.Our current approach uses a custom subclass of
SmtpClient
and needs of the two the logic inIsUntrustedRoot
, which is short enough to copy and adapt which however means replicating something that already exists in the library. We do not needIsKnownMailServerCertificate
, and were us (or others) to need it it would be considerably more unwieldy to repeat.I lack the experience to properly evaluate which of the many other components could be useful to subclasses, but I feel at least the two I noticed could be exposed.
The text was updated successfully, but these errors were encountered: