Python 2.7 会话令牌API SSL证书

Python 2.7 会话令牌API SSL证书,python-2.7,session,ssl,Python 2.7,Session,Ssl,这是我正在使用的代码。(Keypathpub和Keypathprivate)是具有文件SSL证书位置的变量,但它会返回此错误: def session(): #This is trying to get the session toekn programaticly. resp = requests.post('https://identitysso.betfair.com/api/certlogin', data=payload, cert=(Keypathpub, Keypathp

这是我正在使用的代码。(Keypathpub和Keypathprivate)是具有文件SSL证书位置的变量,但它会返回此错误:

def session(): #This is trying to get the session toekn programaticly. 
    resp = requests.post('https://identitysso.betfair.com/api/certlogin', data=payload, cert=(Keypathpub, Keypathprivate), headers=headers)
    if resp.status_code == 200:
        resp_json = resp.json()
        print resp_json['loginStatus']
        sessionToken = resp_json['sessionToken']
    else:
        print "Request failed."
while s > 0:
    session()
    s = 0
我怎么修理它

requests.exceptions.SSLError: [Errno 336445442] _ssl.c:365: error:140DC002:SSL              routines:SSL_CTX_use_certificate_chain_file:system lib
[Finished in 0.5s with exit code 1]