As we transfered twitter chat bot application (python code) from one server to another server. Both servers exactly mirror image. On new server I am getting error in initializing userstream in tweepy.
auth = OAuthHandler(CONSUMER_KEY,CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN,ACCESS_TOKEN_SECRET)
while 1:
try:
twitterStream = Stream(auth,listener())
twitterStream.userstream() #I am getting error here
except BaseException,e:
print "Exception occured"
print int(time.time())
print "Restarting Stream"
time.sleep(30)
print e
continue
Error is
HTTPSConnectionPool(host=‘userstream.twitter.com’, port=443): Max retries exceeded with url: /1.1/user.json?delimited=lengted by NewConnectionError(’: Failed tlish a new connection: [Errno 110] Connection timed out’,))
&
[Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Which configuration I have to make on new server to run this smoothly?
My new server has below details ------ OS – Ubuntu 14.04.5 ------ Python - 2.7.6 ----- Open SSL Version - OpenSSL 1.0.1f ----- requests (2.11.1) ----- tweepy (3.5.0) ----- pyOpenSSL (0.13)