Error using remote_api_shell.py: ssl.SSLError: [Errno 8] _ssl.c:510: EOF occurred in violation of protocol

Error using remote_api_shell.py: ssl.SSLError: [Errno 8] _ssl.c:510: EOF occurred in violation of protocol

我很想使用 remote_api_shell.py 通过以下方式访问我的 Google App Engine 应用程序的数据存储区:

remote_api_shell.py -s url/of/server --secure

但是我收到以下错误:

Traceback (most recent call last):
  File "./remote_api_shell.py", line 133, in <module>
    run_file(__file__, globals())
  File "./remote_api_shell.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 160, in <module>
    main(sys.argv)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 156, in main
    oauth2=True)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 74, in remote_api_shell
    secure=secure)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 768, in ConfigureRemoteApiForOAuth
    rpc_server_factory=rpc_server_factory)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 835, in ConfigureRemoteApi
    app_id = GetRemoteAppIdFromServer(server, path, rtok)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 569, in GetRemoteAppIdFromServer
    response = server.Send(path, payload=None, **urlargs)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appengine_rpc_httplib2.py", line 245, in Send
    url, method=method, body=payload, headers=headers)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/oauth2client/oauth2client/client.py", line 562, in new_request
    redirections, connection_type)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1584, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1332, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1268, in _conn_request
    conn.connect()
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1014, in connect
    self.disable_ssl_certificate_validation, self.ca_certs)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 80, in _ssl_wrap_socket
    cert_reqs=cert_reqs, ca_certs=ca_certs)
  File "/usr/lib/python2.7/ssl.py", line 487, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 243, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 405, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [Errno 8] _ssl.c:510: EOF occurred in violation of protocol

如有任何帮助,我们将不胜感激。

当我从使用我的自定义域名切换到 my-app-id.appspot.com 时,问题就消失了。

其他一些注意事项:

  1. 如果您使用的是 https,那么 your-app-id.appspot.com 将无法立即使用。您必须在域名对应的 Google Apps 页面上启用它。是的,这意味着您实际上必须为该域设置 Google 应用程序。
  2. 如果您有一个多模块设置,请确保将 remote_api: on 添加到 default[=26= 的 app.yamlbuiltins 部分] 模块。或者,如果您有另一个模块的 remote-api: on,则使用跳过 dispatch.yaml 文件并直接以模块为目标的 url。