You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Yesod网站Google OAuth2配置遇连接超时问题求助

排查Yesod中Google OAuth2连接超时问题

我正参照《Yesod官方指南》为Yesod网站配置身份验证与授权功能,设置Google OAuth2后出现连接超时错误,错误信息如下:

HttpExceptionRequest Request {
  host                 = "accounts.google.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("Content-Type","application/x-www-form-urlencoded")]
  path                 = "/o/oauth2/token"
  queryString          = ""
  method               = "POST"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
  proxySecureMode      = ProxySecureWithConnect
}
 ConnectionTimeout

尝试改用yesod-auth-oauth2库后,仍出现同样的连接超时错误:

HttpExceptionRequest Request {
  host                 = "www.googleapis.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("Content-Type","application/x-www-form-urlencoded"),("Authorization","<REDACTED>"),("User-Agent","hoauth2"),("Accept","application/json")]
  path                 = "/oauth2/v3/token"
  queryString          = ""
  method               = "POST"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
  proxySecureMode      = ProxySecureWithConnect
}
 ConnectionTimeout

已完成的配置:

  • 为Web应用启用Google+ API和Contacts API
  • 本地运行网站,配置的授权重定向URI:
    • http://localhost:3000/auth/page/google/callback
    • http://localhost:3000/auth/page/googleemail2/complete

请求协助排查此连接超时问题。

内容的提问来源于stack exchange,提问作者gust

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 00:20:45