SSLError在谷歌应用程序引擎(本地开发服务器) [英] SSLError on Google App Engine (local dev-server)

查看:179
本文介绍了SSLError在谷歌应用程序引擎(本地开发服务器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用App Engine上博托库,我得到了一个错误:

 回溯(最近通话最后一个):
  文件C:\ Program Files文件\谷歌\ google_appengine \谷歌\ AppEngine上\分机\ web应用程序\ _webapp25.py,线路701,在__call__
    handler.get(*组)
  文件E:\探测器\ pruebas \ pruebasAWS \ main.py,第26行,以获取
    康恩= S3Connection('< KEY1>','< KEY2>')
  文件E:\探测器\ pruebas \ pruebasAWS \博托\ S3 \ connection.py,线路148,在__init__
    PATH =路径,供应商=提供商)
  文件E:\探测器\ pruebas \ pruebasAWS \博托\ connection.py,线路231,在__init__
    self.http_unretryable_exceptions.append(ssl.SSLError)
AttributeError的:'模块'对象有没有属性'SSLError
 

从来就安装OpenSSL和Python的2.7。 OpenSSL和SSL库蟒蛇正在运行,当我部署应用到谷歌的基础设施,它工作正常。问题来了,当我尝试执行我的本地机器的应用程序。

在code是:

 从google.appengine.ext进口的webapp
从google.appengine.ext.webapp进口UTIL
从boto.s3.connection进口S3Connection
进口hashlib


类MainHandler(webapp.RequestHandler):
    DEF得到(个体经营):
        康恩= S3Connection('< KEY1>','< KEY2>')
        斗= conn.create_bucket(hashlib.md5('noTRePeaTedBuCket)。hexdigest()+探针)
        如果斗:
            self.response.out.write('斗creado)
        其他:
            self.response.out.write('斗NO creado)
 

解决方案

这里的实际问题是,各地的AppEngine上渣土的东西,使其无法进口一定的标准,内置Python模块,如SSL。

有关于这个的博托IRC的一些谈话,其中一个用户想出了这个补丁:

https://github.com/samba/boto/commit/6f1ab73d92ff6fb2589362bbdadf6bbe66811e7e

这方面的一些形式可能会被很快汇成博托主。

When I try to use boto library on App Engine, I get the next error:

Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\_webapp25.py", line 701, in __call__
    handler.get(*groups)
  File "E:\Probes\pruebas\pruebasAWS\main.py", line 26, in get
    conn = S3Connection('<KEY1>','<KEY2>')
  File "E:\Probes\pruebas\pruebasAWS\boto\s3\connection.py", line 148, in __init__
    path=path, provider=provider)
  File "E:\Probes\pruebas\pruebasAWS\boto\connection.py", line 231, in __init__
    self.http_unretryable_exceptions.append(ssl.SSLError)
AttributeError: 'module' object has no attribute 'SSLError'

I´ve installed OpenSSL and Python 2.7. OpenSSL and SSL library for python are running, and when i deploy the App to the Google Infrastructure, it works fine. The problem comes when I try to execute the app on my local machine.

The code is:

from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from boto.s3.connection import S3Connection
import hashlib


class MainHandler(webapp.RequestHandler):
    def get(self):
        conn = S3Connection('<KEY1>','<KEY2>')
        bucket = conn.create_bucket(hashlib.md5('noTRePeaTedBuCket').hexdigest()+"probe")
        if bucket:
            self.response.out.write('Bucket creado')
        else:
            self.response.out.write('Bucket NO creado')

解决方案

The actual issue here is that AppEngine mucks around with things to make it impossible to import certain standard, builtin python modules such as ssl.

There was some conversation about this on the boto IRC and one of the users came up with this patch:

https://github.com/samba/boto/commit/6f1ab73d92ff6fb2589362bbdadf6bbe66811e7e

Some form of this will probably be merged into boto master soon.

这篇关于SSLError在谷歌应用程序引擎(本地开发服务器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆