.net - Blazor 错误:无法建立 SSL 连接,请参阅内部异常
问题描述
您好,我尝试在 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 = 等待 Http.SendAsync(httpRequestMessage);
INNER EX : 根据验证程序,远程证书无效:RemoteCertificateNameMismatch, RemoteCertificateChainErrors
我收到错误
为所有人
解决方案
好的,当我在 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.
了解更多...</p>
此网站可能不支持 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的所有者/运营商并告诉他们他们的软件已过期。
推荐阅读
- php - 如何在 SQL 中获得最低的唯一出价
- data-visualization - 是否有免费的物联网设备地图和 GPS 记录器服务?(如 Azure IoT Central 中的 Azure Maps)
- vue.js - 使用 axios 将 vue.js 数据对象发送到后端
- jquery - i18next jquery 翻译另一个元素内的元素
- javascript - 手动测试 JavaScript Number.toLocaleString()
- caffe - PRelue 不支持 mmdnn?
- json - 带有 JSON 字段的 Amazon Cloudwatch 日志见解
- augmented-reality - 如何隐藏A帧中的叠加层?
- javascript - 引导功能“显示模式”没有被触发
- c# - 从 Azure 函数连接到 Azure Blob 存储