仅仅是按照官方文档中,写了一个谷歌认证的Handler如下:
class GoogleHandler(tornado.web.RequestHandler, tornado.auth.GoogleMixin):
@tornado.web.asynchronous
def get(self):
if self.get_argument("openid.mode", None):
self.get_authenticated_user(self.async_callback(self._on_auth))
return
self.authenticate_redirect()
def _on_auth(self, user):
if not user:
raise tornado.web.HTTPError(500, "Google auth failed")
print user
但是在实际使用中却出现问题了
登陆到google后成功返回,但是_on_auth函数却没能正确的识别出User
抛出错误如下:
CertificateError: hostname u'www.google.com' doesn't match either of '*.gstatic.com', 'gstatic.com', '*.metric.gstatic.com'
WARNING:root:Invalid OpenID response: hostname u'www.google.com' doesn't match either of '*.gstatic.com', 'gstatic.com', '*.metric.gstatic.com'
为啥会出现这个错误啊。。。求助各位大神。。。
class GoogleHandler(tornado.web.RequestHandler, tornado.auth.GoogleMixin):
@tornado.web.asynchronous
def get(self):
if self.get_argument("openid.mode", None):
self.get_authenticated_user(self.async_callback(self._on_auth))
return
self.authenticate_redirect()
def _on_auth(self, user):
if not user:
raise tornado.web.HTTPError(500, "Google auth failed")
print user
但是在实际使用中却出现问题了
登陆到google后成功返回,但是_on_auth函数却没能正确的识别出User
抛出错误如下:
CertificateError: hostname u'www.google.com' doesn't match either of '*.gstatic.com', 'gstatic.com', '*.metric.gstatic.com'
WARNING:root:Invalid OpenID response: hostname u'www.google.com' doesn't match either of '*.gstatic.com', 'gstatic.com', '*.metric.gstatic.com'
为啥会出现这个错误啊。。。求助各位大神。。。