gpt4 book ai didi

c# - Azure 连接失败,因为连接的主机无法响应 ip :443

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

因此,我实现了一个接口(interface),使用 HttpClient 类发出请求,与其余 Web 服务进行通信。

代码在本地运行得很好,但是当我部署到 Azure 时,我的应用程序无法触发请求,它会在此行崩溃:

using (var response = await HttpClient.PostAsync(uri, content)) { ... }
// uri = https://api-rest.zenvia360.com.br/services/send-sms

确切的异常消息是这样的:

A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond 200.203.125.26:443

网络服务提供商声明“如果您使用防火墙或代理,则必须为我们的 IP 添加异常(exception)。对于 HTTPS,请使用端口 443:
200.203.125.24
200.203.125.25
200.203.125.26(异常消息的ip)
200.203.125.27
200.203.125.28
200.203.125.29"

我在 Azure 中到处寻找防火墙或其他东西,但一无所获。而且这个异常消息非常神秘。我用另一个网址测试了相同的代码(向 www.gooogle.com 发送了一个帖子)并且它有效。

有什么想法吗?

最佳答案

问题出在 Web 服务端。我使用的服务默认阻止国际请求。我要求他们将 Azure 出站 IP 列入白名单,现在可以了。

关于c# - Azure 连接失败,因为连接的主机无法响应 ip :443,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40028667/

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