Hello i try to consume a api in SAP for test , well i have this code , i use .net core 5 and Blazor
private async Task<bool> ValidateUser()
{
try
{
_login.CompanyDB = "VISUALK_CL";
string serializedUser = JsonConvert.SerializeObject(_login);
HttpRequestMessage httpRequestMessage = new HttpRequestMessage();
httpRequestMessage.Method = new HttpMethod("POST");
httpRequestMessage.RequestUri = new Uri("https://office.visualk.cl:50346//b1s/v1/Login");
httpRequestMessage.Content = new StringContent(serializedUser);
httpRequestMessage.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
var response = await Http.SendAsync(httpRequestMessage);
var responseStatusCode = response.StatusCode;
var responseBody = await response.Content.ReadAsStringAsync();
if (responseStatusCode.ToString() == "OK")
{
var returnedUser = JsonConvert.DeserializeObject<Login>(responseBody);
NavManager.NavigateTo("/", forceLoad: true);
}
else
{
}
return await Task.FromResult(true);
}
catch (Exception ex)
{
NavManager.NavigateTo("/LogPostulaciones", forceLoad: true);
throw;
}
}
But when go to line
var response = await Http.SendAsync(httpRequestMessage);
INNER EX : The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch, RemoteCertificateChainErrors
i recive the error
ty for all
Ok, when I drop that URL in Firefox I get
Secure Connection Failed
An error occurred during a connection to office.visualk.cl:50346. Peer using unsupported version of security protocol.
Error code: SSL_ERROR_UNSUPPORTED_VERSION
The page you are trying to view cannot be shown because the authenticity of the received data could not be verified. Please contact the web site owners to inform them of this problem.Learn more…
This web site might not support the TLS 1.2 protocol, which is the minimum version supported by Firefox. Enabling TLS 1.0 and TLS 1.1 might allow this connection to succeed.
TLS 1.0 and TLS 1.1 will be permanently disabled in a future release.
Chrome just shows an error without further information.
This rule is enforced by the Browser, not by Blazor.
You might use Firefox's offer to lower your security by enabling TLS 1.1 but the best course is to contact the owner/operator of office.visualk.cl and tell them their software is out of date.