Twython GET中的SSL错误 [英] SSL Error in Twython GET

查看:120
本文介绍了Twython GET中的SSL错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在玩twython并请求软件包,发现有些奇怪的东西阻止了我的代码来检索tweet.如果有帮助,我正在防火墙后面工作.

I am playing with the twython and requests packages and found something strange which is blocking my code to retrive the tweets. I am working behind the firewall if it helps.

代码:

from twython import Twython
t = Twython(app_key=consumer_key,app_secret=consumer_secret,oauth_token=access_token,oauth_token_secret=access_secret)
a = t.search(q="@Benton",count=100)

import requests
requests.get("https://github.com/timeline.json",verify=False)

Twython请求出错:

Error from Twython Request:

SSLError:[Errno 1] _ssl.c:504:错误:14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败

SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

请求成功

响应[200]

Response [200]

因此,"cacert.pem"对于请求库似乎工作正常,但对于Twython而言却无法正常工作.我假设Twython调用了请求以获取凭据的验证. 是否可以在twyhton呼叫中使用"Verify = False"在Twitter中进行搜索.

So it seems that "cacert.pem" is working fine for Request library but not for Twython. I am assuming the Twython calls the requests to get the verification for the credentials. Is it possible to use "Verify=False" in the twyhton call for search in Twitter.

推荐答案

我认为问题出在防火墙而不是Twython.我在阻止Twitter的网络上收到此错误.

I think the problem is with the firewall rather than with Twython. I get this error on networks that have blocked Twitter.

这篇关于Twython GET中的SSL错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆