Python Beatbox 到 Salesforce 连接到 Salesforce 时出错

Python Beatbox to Salesforce Error Connecting to Salesforce

我刚刚对我的计算机进行了重新映像,并在我的计算机上安装了 Python 2.7.9(64 位)。使用 PIP 我安装了 beatbox 32.1。

当我打电话连接到 Salesforce 时:

sf_client.login(sf_username, sf_password)
logging.info('Connected successfully')

我收到一条错误消息。我只尝试了一直有效的普通登录凭据,并尝试在密码中连接我的令牌。 有没有人 运行 使用 Python Beatbox 遇到这个错误,你知道我可以尝试使用哪些调试选项来查明这个问题吗?

Traceback (most recent call last):
File "C:\myCode\salesforceload_beatbox.py", line 126, in <module>
sf_client.login(sf_username, sf_password)
File "C:\Python27\lib\site-packages\beatbox\python_client.py", line 76, in login
res = BaseClient.login(self, username, passwd)
File "C:\Python27\lib\site-packages\beatbox\_beatbox.py", line 62, in login
lr = LoginRequest(self.serverUrl, username, password).post()
File "C:\Python27\lib\site-packages\beatbox\_beatbox.py", line 330, in post
raise RuntimeError('No response from Salesforce')
RuntimeError: No response from Salesforce

在深入研究之后(并使用请求包调试 HTTP 连接),我在这个级别失败了

Traceback (most recent call last):
File "C:\myCode\SFDC\test_beatbox_call2.py", line 34, in <module>
requests.get(sf_client.login(sf_username, sf_password))
File "C:\Python27\lib\site-packages\beatbox\python_client.py", line 76, in login
res = BaseClient.login(self, username, passwd)
File "C:\Python27\lib\site-packages\beatbox\_beatbox.py", line 78, in login
lr = LoginRequest(self.serverUrl, username, password).post()
File "C:\Python27\lib\site-packages\beatbox\_beatbox.py", line 344, in post
conn.request("POST", path, self.makeEnvelope(), headers)
File "C:\Python27\lib\httplib.py", line 1001, in request
self._send_request(method, url, body, headers)
File "C:\Python27\lib\httplib.py", line 1035, in _send_request
self.endheaders(body)
File "C:\Python27\lib\httplib.py", line 997, in endheaders
self._send_output(message_body)
File "C:\Python27\lib\httplib.py", line 850, in _send_output
self.send(msg)
File "C:\Python27\lib\httplib.py", line 812, in send
self.connect()
File "C:\Python27\lib\httplib.py", line 1216, in connect
server_hostname=server_hostname)
File "C:\Python27\lib\ssl.py", line 350, in wrap_socket
_context=self)
File "C:\Python27\lib\ssl.py", line 566, in __init__
self.do_handshake()
File "C:\Python27\lib\ssl.py", line 788, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

在大量搜索和谷歌搜索 TLS 连接等之后,我注意到这个周末我的 cmd.exe window(我从中 运行 PIP 命令)在 C: 下启动\Windows\System32> 并且我的所有虚拟机都在我的个人用户目录中启动。 所以我搜索了我的漫游 cmd.exe,当我打开它时,它是我的个人用户目录。 在新 cmd.exe 中使用 PIP 卸载和安装 beatbox 后,我通过 Beatbox 进行的所有 Salesforce 调用都像以前一样工作。 现在我无法完全解释为什么会这样,但有些东西告诉我这个管理位置的证书可能与我的个人证书不匹配。我起床了,又 运行ning 了。