我正在尝试在开发环境中使用它的 ip 地址连接到一个开放的 id 权限。显然,在这种情况下,ssl 验证将失败。我想绕过它,到目前为止没有任何运气。我找到了有关此主题的以下答案:
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
当我的应用程序尝试访问 oidc 权限时,我收到相同的错误:
处理请求时发生未处理的异常。AuthenticationException: 根据验证程序,远程证书无效。System.Net.Security.SslStream.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo 异常)
HttpRequestException: 无法建立 SSL 连接,请参阅内部异常。System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancelationToken)
IOException:IDX20804:无法从以下位置检索文档:“https://172.11.0.11:1111/MY_APP/.well-known/openid-configuration”。Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(字符串地址,CancellationToken 取消)
InvalidOperationException:IDX20803:无法从以下位置获取配置:“https://172.11.0.11:1111/MY_APP/.well-known/openid-configuration”。Microsoft.IdentityModel.Protocols.ConfigurationManager.GetConfigurationAsync(CancellationToken 取消)