I have api method it get data in local but after publish not get data
The SSL connection could not be established, see inner exception.
the certificate is install.
[HttpGet("GetDataByLang")]
public async Task<IActionResult> GetDataByLang(string lang)
{
try
{
using (HttpClientHandler handler = new HttpClientHandler())
{
handler.SslProtocols = SslProtocols.Tls13;
using (HttpClient client = new HttpClient(handler))
{
string response = await client.GetStringAsync(_url);
var data = JsonConvert.DeserializeObject<TadawulModeList>(response);
return Ok(data);
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, "An error occurred while making an HTTP request.");
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
}
}