【问题标题】:Blazor Error : The SSL connection could not be established, see inner exceptionBlazor 错误:无法建立 SSL 连接,请参阅内部异常
【发布时间】:2021-07-26 05:55:52
【问题描述】:

您好,我尝试在 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

我收到错误提示

人人皆知

【问题讨论】:

  • 然后向我们展示内部异常(带有堆栈跟踪)。
  • @HenkHolterman 我收到了这个 Inner Exp 值:根据验证程序,远程证书无效:RemoteCertificateNameMismatch, RemoteCertificateChainErrors

标签: .net ssl blazor


【解决方案1】:

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

安全连接失败

连接到 office.visualk.cl:50346 时出错。同行 使用不受支持的安全协议版本。

错误代码: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.

了解更多……

此网站可能不支持 TLS 1.2 协议,该协议是 Firefox 支持的最低版本。启用 TLS 1.0 和 TLS 1.1 可能允许此连接成功。

TLS 1.0 和 TLS 1.1 将在未来版本中永久禁用。

Chrome 只是显示一个错误,没有更多信息。

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

您可能会使用 Firefox 的提议通过启用 TLS 1.1 来降低您的安全性,但最好的方法是联系 office.visualk.cl 的所有者/运营商并告诉他们他们的软件已过期。

【讨论】:

    猜你喜欢
    • 2019-06-29
    • 2021-12-09
    • 1970-01-01
    • 2020-06-25
    • 2019-12-29
    • 1970-01-01
    • 2022-08-31
    • 1970-01-01
    相关资源
    最近更新 更多