在本地,我有一组web应用程序,所有这些应用程序都可以通过一次登录访问。为此,我采用了Identity Server 4。
一旦应用程序发布到本地服务器上,而不能远程访问,我就通过openssl生成了一个SSL证书,并设置IIS使用它。
特别是,我的机器可以通过本地dns访问。例如,我的机器ip为192.168.15.3,别名为app.server.lan
如果我连接到该站点的主页(app.server.lan),Google Chrome会检测到该站点是安全的。但是,当我尝试访问应用程序,然后启动应用程序和身份服务器之间的连接时,我得到一个错误页面,日志中包含以下错误:
2021-02-04 14:09:04.6785|1|ERROR|Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|An unhandled exception has occurred while executing the request.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden]'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: '[PII is hidden]'.
---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote hostPPI是隐藏的:.well-known/openid-配置,如果我通过浏览器检查,它是可见的。
我该怎么解决呢?我可以使用没有https的IdentityServer 4吗?

你看到的黑线是app.server.lan
5000是标识服务器端口
443是主要的应用程序端口
5001到5005是其他应用程序端口
发布于 2021-02-08 18:54:02
下面是从商店获取certioficat的代码:
X509Certificate2 cert = null;
using (var certStore = new X509Store(StoreName.My, StoreLocation.LocalMachine))
{
certStore.Open(OpenFlags.ReadOnly);
var certCollection = certStore.Certificates.Find(
X509FindType.FindByThumbprint,
"<THUMBPRINT>", // Change this with the thumbprint of your certifiacte
false);
if (certCollection.Count > 0)
{
cert = certCollection[0];
}
}和
if(cert == null)
{
// If the certificate is not installed, you might be in development and want to ise the developer credebntials
services.AddIdentityServer()
.AddDeveloperSigningCredential();
}
else
{
services.AddIdentityServer()
.AddSigningCredential(cert);
}确保运行IdentityServer应用程序的应用程序池标识有权访问私钥。如果没有,就给它权限。
在iis应用程序池高级设置中将加载用户配置文件设置为"true“。
https://stackoverflow.com/questions/66046362
复制相似问题