Python 2.7 博托+;GoogleAppEnginer:“;无法获取URL:http://cloudfront.amazonaws.com/2010-11-01/distribution/<CF_DIST_ID>&引用;。拒绝连接

Python 2.7 博托+;GoogleAppEnginer:“;无法获取URL:http://cloudfront.amazonaws.com/2010-11-01/distribution/<CF_DIST_ID>&引用;。拒绝连接,python-2.7,boto,amazon-cloudfront,google-app-engine-python,Python 2.7,Boto,Amazon Cloudfront,Google App Engine Python,我正在谷歌应用引擎项目中运行这些代码 from boto import cloudfront con = cloudfront.CloudFrontConnection( AWS_ACCESS_KEY, AWS_SECRET_KEY ) distro_info = con.get_distribution_info(DOWNLOAD_DIST_ID) 当它执行到上面的最后一行时,我收到了一堆警告/错误消息,如下所示: WARNING 2015-04-22 07:15:58

我正在谷歌应用引擎项目中运行这些代码

from boto import cloudfront

con = cloudfront.CloudFrontConnection(
    AWS_ACCESS_KEY,
    AWS_SECRET_KEY
)

distro_info = con.get_distribution_info(DOWNLOAD_DIST_ID)
当它执行到上面的最后一行时,我收到了一堆警告/错误消息,如下所示:

WARNING  2015-04-22 07:15:58,620 urlfetch_stub.py:504] Stripped prohibited headers from URLFetch request: ['Content-Length', 'Host']
WARNING  2015-04-22 07:15:59,811 urlfetch_stub.py:504] Stripped prohibited headers from URLFetch request: ['Content-Length', 'Host']
WARNING  2015-04-22 07:16:02,105 urlfetch_stub.py:504] Stripped prohibited headers from URLFetch request: ['Content-Length', 'Host']
WARNING  2015-04-22 07:16:05,961 urlfetch_stub.py:504] Stripped prohibited headers from URLFetch request: ['Content-Length', 'Host']
WARNING  2015-04-22 07:16:07,010 urlfetch_stub.py:504] Stripped prohibited headers from URLFetch request: ['Content-Length', 'Host']
WARNING  2015-04-22 07:16:08,088 urlfetch_stub.py:504] Stripped prohibited headers from URLFetch request: ['Content-Length', 'Host']
WARNING  2015-04-22 07:16:29,897 urlfetch_stub.py:504] Stripped prohibited headers from URLFetch request: ['Content-Length', 'Host']
ERROR    2015-04-22 07:17:24,921 webapp2.py:1528] An error occured while connecting to the server: Unable to fetch URL: http://cloudfront.amazonaws.com/2010-11-01/distribution/XXXXX4K3XXXXX Error: [Errno 61] Connection refused
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 1077, in __call__
    return handler.dispatch()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 547, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 545, in dispatch
    return method(*args, **kwargs)
  File "/Users/antkong/dev/test-signed-cookie/testmain.py", line 218, in get
    domain, cookies = generate_signed_cookies(s3resource, expire_minutes=expireLen)
  File "/Users/antkong/dev/test-signed-cookie/testmain.py", line 107, in generate_signed_cookies
    distro_info = con.get_distribution_info(DOWNLOAD_DIST_ID)
  File "lib/boto/cloudfront/__init__.py", line 158, in get_distribution_info
    return self._get_info(distribution_id, 'distribution', Distribution)
  File "lib/boto/cloudfront/__init__.py", line 86, in _get_info
    response = self.make_request('GET', uri)
  File "lib/boto/connection.py", line 1068, in make_request
    retry_handler=retry_handler)
  File "lib/boto/connection.py", line 943, in _mexe
    response = connection.getresponse()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/dist27/gae_override/httplib.py", line 536, in getresponse
    'An error occured while connecting to the server: %s' % e)
error: An error occured while connecting to the server: Unable to fetch URL: http://cloudfront.amazonaws.com/2010-11-01/distribution/XXXXX4K3XXXXX Error: [Errno 61] Connection refused
如果我把它作为一个独立的脚本来运行,那么根本就没有问题


有人知道问题出在哪里吗?

您正在使用http URL,而CloudFront API在http上不可用,仅在https上可用