I am using a library called Refit to access a RESTful service
public interface IApiClient
{
[Get("/{Id}/shifttimes")]
Task<ShiftTimesResponse> GetShiftTimes(int id);
}
And I'm initializing the interface in DI:
builder.Register(ctx =>
{
var baseUri = new Uri(config.ApiUri);
var client = RestService.For<IApiClient>(baseUri.OriginalString);
return client;
}).As<IApiClient>().InstancePerTenant();
Which is then used in myHandler:
public class ShiftTimesHandler
{
private readonly IApiClient _apiClient;
public ShiftTimesHandler(
IApiClient apiClient)
{
_apiClient= apiClient;
}
public async Task Execute(Message message)
{
**Error on this line**
var shiftTimesResponse = await _apiClient.GetShiftTimes(message.Id);
//Do something
}
}
The exception is:
The SSL connection could not be established, see inner exception.
The inner exception is:
The remote certificate is invalid according to the validation procedure.: AuthenticationException