金蝶部署在公有云服务调用外部链接报错:错误为:System.Net.WebException: 基础连接已经关闭: 发送时发生错误。

刚开始一直以为是因为外部链接是https的问题。就一直更改安全协议。代码改为:

if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))

{

//创建HttpWebRequest

request = WebRequest.Create(url) as HttpWebRequest;

//获取或设置由 ServicePointManager 对象管理的 ServicePoint 对象所使用的安全协议。

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072 | (SecurityProtocolType)192 | (SecurityProtocolType)768; // SecurityProtocolType.Tls1.2;

//获取或设置用于验证服务器证书的回调。

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);

request.ProtocolVersion = HttpVersion.Version11;

}

else

{

request = WebRequest.Create(url) as HttpWebRequest;

}

重新部署后还是不行,后来查询资料发现是需要在天梯配置外部链接的白名单。配置白名单后。功能就可以正常使用。

天梯配置白名单链接:https://vip.kingdee.com/article/319854834079784704?channel_level=%E9%87%91%E8%9D%B6%E4%BA%91%E7%A4%BE%E5%8C%BA%7C%E6%90%9C%E7%B4%A2%7C%E7%BB%BC%E5%90%88&productLineId=1&isKnowledge=2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值