gpt4 book ai didi

Azure混合连接 "No such host is known"

转载 作者:太空宇宙 更新时间:2023-11-03 13:20:33 25 4
gpt4 key购买 nike

我有一个简单的 Asp.Net Core Azure Web 应用程序,需要向本地 Rest 服务发出 http get 请求。此 Rest 服务托管在 IIS 上,仅针对端口 443 设置了绑定(bind)。我已在 Azure 中设置了一个新的混合连接并将其添加到 Web 应用程序中。在本地端,我安装了混合连接管理器并输入了混合连接的连接字符串 - 现在显示为“已连接”。

问题是,当执行发出get请求的代码行时,抛出以下错误:

System.AggregateException: One or more errors occurred. (No such host is known) ---> System.Net.Http.HttpRequestException: No such host is known ---> System.Net.

这里有一篇有趣的博客文章:Microsoft Blog其中规定应在不使用完全限定域名 (FQDN) 的情况下设置连接 - 服务器名称以 Organization.co.uk 为后缀。但是,据我所知,Rest 服务的 SSL 证书需要 FQDN - 否则会出现错误

There is a problem with this website’s security certificate 

有人知道如何排查并解决此问题吗?

最佳答案

第一个错误可能是 DNS 问题。如that blog提到过

If you are using a fully-qualified domain name, you need to ensure that it’s a name that can be resolved within your local network. (In some cases, customers are running DNS in the local network, and it’s that local DNS service that resolves the name.)

因此,如果您必须在混合连接的连接字符串中使用 FQDN。您可以使用只能由本地 DNS 服务解析的 FQDN。

或者,您可以尝试编辑主机文件,以便最好在本地网络内进行 DNS 查找。在 Rest 服务服务器主机文件(位于 %WINDIR%\system32\drivers\etc)中添加一行,将 IIS 服务器的 IP 映射到名称。

例如:

192.168.0.50   serverFQDN

更多详情,请参阅this .

关于Azure混合连接 "No such host is known",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54861634/

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