Blazor Error : The SSL connection could not be established, see inner exception

Blazor Error : The SSL connection could not be established, see inner exception

你好,我尝试在 SAP 中使用 api 进行测试,我有这段代码,我使用 .net core 5 和 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;
    }
}

但是当去线时

var response = await Http.SendAsync(httpRequestMessage);

内心 EX : 根据验证程序,远程证书无效:RemoteCertificateNameMismatch、RemoteCertificateChainErrors

我收到错误

所有人都喜欢

好的,当我在 Firefox 中删除 URL 时,我得到

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 只是显示错误,没有更多信息。

此规则由浏览器而非 Blazor 强制执行。

您可以使用 Firefox 的提议通过启用 TLS 1.1 来降低您的安全性,但最好的办法是联系 owner/operator of office.visualk.cl 并告诉他们他们的软件已经过时了。