C# 谷歌API响应时间非常高

C# 谷歌API响应时间非常高,c#,azure,google-api,google-calendar-api,C#,Azure,Google Api,Google Calendar Api,我正在使用google RESTApis管理google日历 检查当前“访问令牌是否有效”的一个特定api调用仅在azure环境中占用额外的时间(2分钟),而在localhost和其他非azure环境中,相同的调用仅占用几秒钟 string url = "https://www.googleapis.com/oauth2/v2/tokeninfo?access_token=" + AccessToken; var request = (HttpWebRequest)WebRequest.Crea

我正在使用google RESTApis管理google日历

检查当前“访问令牌是否有效”的一个特定api调用仅在azure环境中占用额外的时间(2分钟),而在localhost和其他非azure环境中,相同的调用仅占用几秒钟

string url = "https://www.googleapis.com/oauth2/v2/tokeninfo?access_token=" + AccessToken;
var request = (HttpWebRequest)WebRequest.Create(url);
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";

byte[] bytes = Encoding.UTF8.GetBytes(string.Empty);

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;

using (var stream = request.GetRequestStream())
{
    stream.Write(bytes, 0, bytes.Length); //Push it out there
}

var resp = request.GetResponse();

任何帮助都将不胜感激。提前谢谢。

我有点惊讶谷歌居然让你使用TLS1.1。如果您的框架版本是4.5+,请删除设置SecurityProtocol的行,看看是否有任何差异。有趣的是,其他主机如何?
google.com
也需要那么长时间才能解决吗?
nmap——脚本ssl枚举密码
说谷歌接受TLS 1.0、1.1和1.2,这不应该是问题所在,也没有解释超时,TLS握手在一秒钟内失败。