【发布时间】:2021-03-23 14:34:39
【问题描述】:
我有一个身份服务器、一个 Web API 和一个前端应用程序。通常它们在 localhost 上运行并且运行良好。现在我需要在我的本地 IP 地址上运行该应用程序。我将所有设置从 localhost:port 更改为
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '<my_ip>:5003/.well-known/openid-configuration'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: '<my_ip>:5003/.well-known/openid-configuration'.
---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
我尝试生成一个自签名证书并添加到证书存储中,我在 SO 上尝试了许多解决方案,即this one。我所做的只是从这个错误中切换到Keyset does not exist
这是我尝试加载证书的方式:
var key = Configuration["certBase64"]; // exported from store as x509 base64 encoded
var pfxBytes = Convert.FromBase64String(key);
var cert = new X509Certificate2(pfxBytes, "<certificate-pwd>", X509KeyStorageFlags.MachineKeySet);
builder.AddSigningCredential(cert);
我错过了什么?
更新
我还尝试为我的 IP 使用本地 DNS 名称。在我的路由器上,我设置了从 myapp.local 到
当前错误:
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'myapp.local:5003/.well-known/openid-configuration'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'myapp.local:5003/.well-known/openid-configuration'.
---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
【问题讨论】:
标签: ssl identityserver4