The C# service is using RestSharp to fetch some data from the given url. The remote site uses ssl. The task is recurring on every 5 minutes and doing fine.
However, on every few hours the service is getting:
System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
I saw that some people are suggesting avoiding the certificate validation, but I don't think it's a good idea.
Does anyone have the idea what could be the cause of this strange behaviour?