【问题标题】:SSL certificates on Google App EngineGoogle App Engine 上的 SSL 证书
【发布时间】:2013-03-27 01:23:33
【问题描述】:

我在开始使用 GAE(OS X 10.6.8 和 Python 2.7 上的 1.7.6)时遇到问题,与亚马逊服务相比,它非常糟糕。但是,我想至少部署示例应用程序。在解决了其他问题之后,我现在准备好部署一个小型示例应用程序。当我尝试部署它时,我收到如下 SSL 错误:

 *** Running appcfg.py with the following flags:
    --no_cookies --email=mathsboy@gmail.com --passin update
02:15 PM Host: appengine.google.com
02:15 PM Application: tew-helloworld; version: 1
Traceback (most recent call last):
  File "google_appengine/appcfg.py", line 171, in <module>
    run_file(__file__, globals())
  File "google_appengine/appcfg.py", line 167, in run_file
    execfile(script_path, globals_)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4155, in <module>
    main(sys.argv)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4146, in main
    result = AppCfgApp(argv).Run()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2334, in Run
    self.action(self)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3881, in __call__
    return method()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2892, in Update
    updatecheck.CheckForUpdates()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/sdk_update_checker.py", line 258, in CheckForUpdates
    runtime=runtime))
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py", line 393, in Send
    f = self.opener.open(req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 394, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 412, in _open
    '_open', req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1207, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py", line 383, in do_open
    url_error.reason.args[1])
fancy_urllib.InvalidCertificateException: Host appengine.google.com returned an invalid certificate (_ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed): 
To learn more, see http://code.google.com/appengine/kb/general.html#rpcssl
If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** appcfg.py has finished with exit code 1 ***

在另一个线程中对此有一些建议,指出您需要删除 cacerts.txt,尽管我无法在 OS X 上找到此文件。此外,为了让代码上传我似乎很迟钝' d 必须删除一个 cacert 文本文件。但也许我是个白痴。

我在这里面临的另一个问题是,由于管理 python 版本的困难,OS X 不能很好地与 GAE 一起工作。在安装了多个版本的 python、EPD、ActiveState、MacPorts 之后,我现在手头一团糟。尽管有保证,但这些都不能解决我早期的问题。这真是谷歌应用管理的状态,实在是太骇人听闻了。似乎 GAE 是由一群来自 90 年代中期微软的人构建的......任何关于上述问题的建议将不胜感激。干杯

【问题讨论】:

    标签: google-app-engine python-2.7


    【解决方案1】:

    您的错误中倒数第四行。链接下的相关说明。

    http://code.google.com/appengine/kb/general.html#rpcssl

    确保(来自文档):

    To do this you must have the ssl Python module installed on your system.

    【讨论】:

      【解决方案2】:

      解决方法:在运行dev_appserver.py 时使用命令行参数--skip_sdk_update_check=yes


      我遇到了同样的问题,并注意到每次启动应用程序时 GUI 工具 (GoogleAppEngineLauncher) 都会使用 --skip_sdk_update_check=yes。这是从 SDK 1.8.7 开始的。

      根本原因似乎是 GAE 开发服务器的模块白名单系统中的 known bug。即使您安装了 ssl 模块(如文档所述),ssl 仍依赖于未列入白名单的 _ssl。这就是为什么您可以在常规 python shell 会话中毫无问题地执行import ssl,但在 GAE 应用程序中执行同一行时会出错。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-09-17
        • 2017-05-28
        • 2012-09-29
        • 2017-10-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多