0
我試圖使用Google plus API來瀏覽OAuth2流程。httplib2.CertificateHostnameMismatch in Google plus API
我得到了驗證者,我將要交換訪問令牌,然後發生錯誤。
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
如果我是正確的,你還需要通過request_token你有第一步得到access_token – 2011-12-17 05:02:39