gpt4 book ai didi

xamarin.forms - System.Net.WebException : Error: TrustFailure (Authentication failed, 请参阅内部异常。)

转载 作者:行者123 更新时间:2023-12-05 07:10:55 24 4
gpt4 key购买 nike

在向 HTTPS 服务器发出请求时,出现以下错误。请求适用于 HTTP。

{System.Net.WebException: Error: TrustFailure (Authentication failed, see inner exception.) ---> System.Security.Authentication.AuthenticationException: Authentication failed, 见内部异常。 ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

我已在 Android 设置中将 HTTPClientHandler 设置为 Android 并将 TLS/SSL Implementation 设置为 Native TLD 1.2+。

最佳答案

这就是我使用 WebClient 实现的方式,而不仅仅是添加 ServerCertificateValidationCallback

var uri = new UriBuilder("https://url/v3/0").Uri;
var client = new WebClient();
ServicePointManager.ServerCertificateValidationCallback = new
RemoteCertificateValidationCallback
(
delegate { return true; }
);
var content = client.DownloadString(uri);

关于xamarin.forms - System.Net.WebException : Error: TrustFailure (Authentication failed, 请参阅内部异常。),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61040219/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com