I am using Restsharp request to an API and codes are blow:
var client = new RestClient(baseURL);
var request = new RestRequest(url);
request.AddHeader("Authorization", authHeader);
var response = client.Get<T>(request);
return response;
Same code did not raise any error on my test enviroment, but when I run the code on server, I get following error:
error message : The SSL connection could not be established, see inner exception. The remote certificate is invalid according to the validation procedure.
exception : System.Net.WebException: The SSL connection could not be established, see inner exception. The remote certificate is invalid according to the validation procedure. ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
I don't know what is wrong with that code and I don't understand why same codes run differently?
Any help for fix that?