gpt4 book ai didi

Azure 网站和 Google Api

转载 作者:行者123 更新时间:2023-12-01 02:34:01 24 4
gpt4 key购买 nike

我一直在玩 azure 的网站。我正在使用一些 google api,但似乎一旦部署在 Azure 网站上,请求 Google API 时就会出现问题:

The request was aborted: Could not create SSL/TLS secure channel.

我不确定它来自哪里,因为我可以使用 HTTPS 浏览我的网站,也许它来自 IIS ARR 插件?

编辑我正在添加一些代码

@mcollier 我正在使用 WebClient 进行调用。下载结果失败(http get 请求)

  try
{
WebClient webClient = new WebClient();

string request = string.Format("https://www.googleapis.com/books/v1/volumes?q=intitle:{0}&fields=items(volumeInfo)&maxResults=1&printType=books&key={1}", infos.Value, ConfigurationHelper.GoogleKey);
content = webClient.DownloadString(request);
}
catch (Exception ex)
{
throw new Exception("content from WebClient : " + content, ex);
// Log.
}

最佳答案

将其添加到 Global.asax.cs 中的 Application_Start 应该可以解决您的问题:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

关于Azure 网站和 Google Api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11170528/

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