"MailKit.Security.SslHandshakeException" error after configuring the MailNotification.

Hi,

OneIM Version 8.2.1

 https://i.postimg.cc/dVtsRFrh/Microsoft-Teams-image.png

 

After configuring the mail notification I'm getting the below error:

<e>2023-01-16 13:18:45 +01:00 - \IAM-JOBTST-SVR - VI.JobService.JobComponents.MailComponent - 8555c0d8-a1cd-46c2-a2ae-eff5db8ac62f: Errors occurred
    Certificate validation errors: RemoteCertificateChainErrors
    Certificate chain status:
      UntrustedRoot - A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.

      NotTimeValid - A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file.

    [MailKit.Security.SslHandshakeException] An error occurred while attempting to establish an SSL or TLS connection.

    This usually means that the SSL certificate presented by the server is not trusted by the system for one or more of
    the following reasons:

    1. The server is using a self-signed certificate which cannot be verified.
    2. The local system is missing a Root or Intermediate certificate needed to verify the server's certificate.
    3. A Certificate Authority CRL server for one or more of the certificates in the chain is temporarily unavailable.
    4. The certificate presented by the server is expired or invalid.
    5. The set of SSL/TLS protocols supported by the client and server do not match.

    See https://github.com/jstedfast/MailKit/blob/master/FAQ.md#SslHandshakeException for possible solutions.

    [System.Security.Authentication.AuthenticationException] The remote certificate is invalid according to the validation procedure.
       at StdioProcessor.StdioProcessor._Execute(Job job)
       at VI.JobService.JobComponents.MailComponent.Activate(String task)
       at VI.JobService.JobComponents.MailComponent._SendRichMail()
       at VI.JobService.JobComponents.MailComponent._Send(MimeMessage message, MailSecurity security)
       at VI.JobService.JobComponents.MailComponent._GetOrOpenSmtpConnection()
       at VI.Mail.SmtpHandling.OpenConnection(SmtpParameters parameters, Action`1 infoMessageHandler, Stream smtpLogStream)
       at MailKit.Net.Smtp.SmtpClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    --- End of stack trace from previous location where exception was thrown ---
       at MailKit.Net.Smtp.SmtpClient.<ConnectAsync>d__93.MoveNext()
       ---- Start of Inner Exception ----
       at MailKit.Net.Smtp.SmtpClient.<ConnectAsync>d__93.MoveNext()
       at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
       at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)

 


When I'm sending test mail through PowerShell command it's working and mail notification is triggering to user.

 

Any suggestions?