如何发布SSLError:[Errno 8] _ssl.c:510:EOF是否违反协议?

时间:2017-12-13 21:26:04

标签: python python-requests socks

我运行此python代码,此代码在我的笔记本电脑中正确但在服务器上传后显示此错误:

OS in server is: Ubuntu 14.04.3 LTS

flight_page = f.get("https://{}/Search/{}-{}/{}".format(self.site, self.from, self.to, date), timeout=30, verify=False)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 467, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 385, in send
raise SSLError(e)
SSLError: [Errno 8] _ssl.c:510: EOF occurred in violation of protocol

我的代码是:

import requests
import socks
import socket

socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "{}".format(proxy_row['ip']), proxy_row['port'])
socket.socket = socks.socksocket
f = requests.Session()

flight_page = f.get("https://{}/Search/{}-{}/{}".format(self.site, self.from, self.to, date), timeout=30, verify=False)

如何发布

0 个答案:

没有答案