我尝试使用 Google plus API 来完成 OAuth2 过程。
我得到了验证者并准备交换访问令牌,然后发生错误。
httplib2.CertificateHostnameMismatch:
Server presented certificate that does not match host accounts.google.com:
服务器提供的证书与主机www.googleapis.com不匹配
提供的证书(通用名称)为*.g.doubleclick.net
为什么他们不一样??
我的代码是这样的:
from oauth2client.client import flow_from_clientsecrets
CLIENT_SECRETS = 'client_secrets.json'
MISSING_CLIENT_SECRETS_MESSAGE = ""
FLOW = flow_from_clientsecrets(CLIENT_SECRETS,
scope='https://www.googleapis.com/auth/plus.me',
message=MISSING_CLIENT_SECRETS_MESSAGE)
FLOW.step1_get_authorize_url()
# the url is outputted and
# my browser forward to it to get the verifier
FLOW.step2_exchange(verifier)
# I paste the verifier and execute this line, then error occurred.
有什么提示吗?
PS:
我的urllib2
版本是0.7.2