【问题标题】:Postman / Curl not working with Google App engine deployed appPostman / Curl 无法与 Google App 引擎部署的应用一起使用
【发布时间】:2017-10-28 13:38:54
【问题描述】:

我在 Google App Engine(标准)上部署了一个 Django 应用程序,如果我通过浏览器(任何)访问它,它就可以正常工作。但是,我无法在终端上使用 curl 或使用 Postman 应用程序运行任何测试。当我尝试运行 curl 时,它会超时:

curl --verbose -X GET "https://SERVER.appspot.com"
Note: Unnecessary use of -X or --request, GET is already inferred.
* Rebuilt URL to: https://SERVER.appspot.com/
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connected to SERVER.appspot.com (x.x.x.x) port 443 (#0)
* Operation timed out after 300225 milliseconds with 0 out of 0 bytes received
* Curl_http_done: called premature == 1
* Closing connection 0
curl: (28) Operation timed out after 300225 milliseconds with 0 out of 0 bytes received

知道我做错了什么吗?同一个应用程序在本地运行良好,我可以在其上运行 Postman / curl。如果我用http:// 而不是https:// 尝试相同的方法(即curl 或Postman),它工作得很好(但https:// 在使用浏览器时工作)。

我需要做什么才能让它从终端工作?

【问题讨论】:

标签: google-app-engine curl postman google-app-engine-python


【解决方案1】:

原来是 SSL“信任”问题。需要为映射到 App Engine 实例的每个子域添加 SSL 支持。事实证明,如果您没有正确执行此操作(在我的情况下,.crt 包中缺少一个 CA 中间证书),您的浏览器可能会认为该站点是安全的,但 curl / postman 将失败 - 或者更确切地说是超时没有告诉你太多。我可以在我的子域上运行一些测试:https://www.ssllabs.com/ssltest

它指出提供的 CA 证书不完整并将其评为 B。修复此问题立即解决了 curl 和 postman 问题(我假设 postman 内部使用 curl ?我离题了)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-23
    • 1970-01-01
    • 1970-01-01
    • 2015-02-11
    • 2019-10-10
    • 2016-09-21
    相关资源
    最近更新 更多