System.Net.Http.WinHttpException: A security error occurred
Technical details:
- sendgrid-csharp Version: 9.9.0
- Platform : ASP.NET Core 2.0
Issue Summary:
This issue is coming while sending email to user. This issue is coming some time, 2 or 3 time a day. Please let me know what is the reason for this issue.
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A security error occurred
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.Tasks.RendezvousAwaitable1.GetResult()
at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SendGrid.Helpers.Reliability.RetryDelegatingHandler.<SendAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at System.Net.Http.HttpClient.
Hello @grana601,
Thanks for reporting this issue!
This looks like an intermittent networking error. I'm thinking these errors might happen when your server can't talk to ours correctly.
Understanding that the issue happens 2-3 times a day, can you please provide some context? (i.e. what percentage does 2-3 errors mean?)
My suggestion would be to catch this error in your code, log and implement some retry logic.
With best regards,
Elmer
2 % chance error comes in a day
Hello @grana601,
I'm closing this issue as it's not related to this helper library. If you require further assistance on this issue, please open a ticket at https://support.sendgrid.com.
Thanks!
With best regards,
Elmer