Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试通过龙卷风蜘蛛使用代理,SSL错误发生_Ssl_Tornado - Fatal编程技术网

尝试通过龙卷风蜘蛛使用代理,SSL错误发生

尝试通过龙卷风蜘蛛使用代理,SSL错误发生,ssl,tornado,Ssl,Tornado,我运行了一个类似tornado编写的spider课程,将httpclient.asynchtpclient更改为curl\u httpclient.curlsynchtpclient by httpclient.AsyncHTTPClient.configure('tornado.curl_httpclient.CurlAsyncHTTPClient') spider运行在Windows10.python3+,64上 不幸的是,错误来了: tornado.curl_httpclient.Cur

我运行了一个类似tornado编写的spider课程,将httpclient.asynchtpclient更改为curl\u httpclient.curlsynchtpclient by

httpclient.AsyncHTTPClient.configure('tornado.curl_httpclient.CurlAsyncHTTPClient')
spider运行在Windows10.python3+,64上

不幸的是,错误来了:

tornado.curl_httpclient.CurlError: HTTP 599: SSL certificate problem: unable to get local issuer certificate
有人看到了吗?我在谷歌上搜索过,但是对于蜘蛛中的龙卷风演示还不够多,我没有找到答案吗


或者任何人都可以告诉我有关错误的信息?

请尝试在curl\u httpclient.curlsynchtpclient中覆盖一个方法

curl_log = logging.getLogger('tornado.curl_httpclient')
class PersonAsyncHTTPClient(curl_httpclient.CurlAsyncHTTPClient):
    def _curl_create(self):
        curl = pycurl.Curl()

        curl.setopt(pycurl.CAINFO, certifi.where()) # the soure had no this line.missing this line would come ssl error.

        if curl_log.isEnabledFor(logging.DEBUG):
            curl.setopt(pycurl.VERBOSE, 1)
            curl.setopt(pycurl.DEBUGFUNCTION, self._curl_debug)
        if hasattr(pycurl, 'PROTOCOLS'):  # PROTOCOLS first appeared in pycurl 7.19.5 (2014-07-12)
            curl.setopt(pycurl.PROTOCOLS, pycurl.PROTO_HTTP | pycurl.PROTO_HTTPS)
            curl.setopt(pycurl.REDIR_PROTOCOLS, pycurl.PROTO_HTTP | pycurl.PROTO_HTTPS)
        return curl
当我们使用:

http_client = PersonAsyncHTTPClient()
req = httpclient.HTTPRequest(url='https://www.google.com.hk/', proxy_host='', proxy_port=1234)
一切都会成功吗

就这些~