1

在尝试访问云托管应用程序https://www.quickbase.com/时,我需要帮助验证公司防火墙内的 SSL 证书。当我在家运行脚本时,pyquickbase 模块可以完美运行。这是我的代码和回溯供您参考。

    ### Python script to log into database
    import quickbase
    client = quickbase.Client(username='JohnDoe',password='OpenQB', database='qb_database',
                              apptoken='xxxdfdafd', base_url="https://www.quickbase.com")

    response = client.list_db_pages(database='qb_database')
    print(response)
    ###

回溯(最近一次通话最后):

    File "D:\Users\User123\Documents\pyfund\Quickbase\QB_api_check.py", line 3, in <module>
apptoken='xxxdfdafd', base_url="https://www.quickbase.com")
    File "C:\Python27\lib\site-packages\quickbase.py", line 191, in __init__
self.authenticate()
    File "C:\Python27\lib\site-packages\quickbase.py", line 263, in authenticate
required=['ticket', 'userid'], ticket=False)
    File "C:\Python27\lib\site-packages\quickbase.py", line 219, in request
request = requests.post(url, data, headers=headers)
    File "C:\Python27\lib\site-packages\requests\api.py", line 111, in post
return request('post', url, data=data, json=json, **kwargs)
    File "C:\Python27\lib\site-packages\requests\api.py", line 57, in request
return session.request(method=method, url=url, **kwargs)
    File "C:\Python27\lib\site-packages\requests\sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
    File "C:\Python27\lib\site-packages\requests\sessions.py", line 585, in send
r = adapter.send(request, **kwargs)
    File "C:\Python27\lib\site-packages\requests\adapters.py", line 477, in send
raise SSLError(e, request=request)
    SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
4

1 回答 1

0

好的,我尝试使用 OS 环境变量设置代理,但由于 requests.get 要求我在调用中传递代理,所以这不起作用。我创建了一个代理字典

proxyDict = { 
              "http"  : http_proxy, 
              "https" : https_proxy, 
              "ftp"   : ftp_proxy
            }

https 是接收 SSL 证书所必需的。我现在必须修改我用来在调用中显式包含代理的 quickbase 和 pybase 模块。

于 2016-07-22T17:23:23.673 回答