Python/Google OAuth2 ssl错误

Python/Google OAuth2 ssl错误,python,ssl,oauth2,Python,Ssl,Oauth2,通过工作,我成功地接收到带有代码的重定向uri。我复制返回URL中“code=”之后的所有内容,并将其提交给step2.exchange(code)命令,但python显示以下错误: 文件“C:\Python34\lib\ssl.py”,第810行,在do_握手中 self.\u sslobj.do\u handshake()ssl.SSLError:[ssl:CERTIFICATE\u VERIFY\u FAILED]CERTIFICATE VERIFY FAILED(\u ssl.c:600

通过工作,我成功地接收到带有代码的重定向uri。我复制返回URL中“code=”之后的所有内容,并将其提交给step2.exchange(code)命令,但python显示以下错误:

文件“C:\Python34\lib\ssl.py”,第810行,在do_握手中 self.\u sslobj.do\u handshake()ssl.SSLError:[ssl:CERTIFICATE\u VERIFY\u FAILED]CERTIFICATE VERIFY FAILED(\u ssl.c:600)

我的问题如下:

1.)代码的正确格式是什么?只需返回url中“code=”之后的所有字符

2.)还有什么可能导致此错误?我按照其他地方的建议安装了certifi 2015.04.28,但这并没有解决问题

3.)还有其他需要解决的建议吗

代码如下

from oauth2client.client import flow_from_clientsecrets

from selenium import webdriver
from selenium.webdriver.common.keys import Keys



flow = flow_from_clientsecrets('C:\Python34\client_secrets.json',
                               scope='https://www.googleapis.com/auth/drive',
                               redirect_uri='https://www.samtec.com)
auth_uri = flow.step1_get_authorize_url()



#open firefox, send auth_uri to the interwebs
driver = webdriver.Firefox()
driver.get(auth_uri)

name=driver.find_element_by_name("Email")
name.send_keys("******")
name.send_keys(Keys.RETURN)

#wait 10 seconds for the page to load before proceeding
#driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);
driver.implicitly_wait(10)
passw=driver.find_element_by_name("Passwd")
passw.send_keys("*******")
passw.send_keys(Keys.RETURN)


#wait for page to load, approve access token
driver.implicitly_wait(10)
allow=driver.find_element_by_id("submit_approve_access")
allow.send_keys(Keys.RETURN)

#get the URL returned to the browser, get the returned code
returnedURL=driver.current_url
if "=" in returnedURL:
    param, code = returnedURL.split("=",1)

##remove white space
code=code.strip()

##obtain he OAuth2 object/tokens
credentials = flow.step2_exchange(code) ##error occurs on this line
使用python 3.4.3


谢谢

不确定是否有修复方法,但我使用
redirect\u uri='class2]测试了您的代码http://localhost:80“
在本地,它确实可以工作,因此代码逻辑本身没有任何错误