Creating an SSL connection


#1

I am attempting to download a dataset for some analyses study. When I start the stream I get an error “”{“errors”:[{“message”:“SSL is required”,“code”:92}]}". I realise I have to set up a SSL certificate. But as a newbe, the documentation is of no help. Can someone explain in simple terms what AND how I set this up. Many thanks.


#2

You don’t need to use a client certificate to connect; you just need to make sure that you’re hitting https://stream.twitter.com and not http://stream.twitter.com.


#3

Isaach, many thanks for quick response. I’m trying to use a python script that gets the Tweets and does a bit of sorting etc. The part of the code relating to the Twitter url is:

def oauth_get_tweet(tid, http_method="GET", post_body='',
        http_headers=None):
    url = 'http://api.twitter.com/1.1/statuses/show.json?id=' + tid
    consumer = oauth.Consumer(key=CONSUMER_KEY, secret=CONSUMER_SECRET)
    token = oauth.Token(key=ACCESS_KEY, secret=ACCESS_SECRET)
    client = oauth.Client(consumer, token)
 
    resp, content = client.request(
        url,
        method=http_method,
        body=post_body,
        headers=http_headers
    )

Does this make sense?

Appreciating your assistance.


#4

Sure, it makes sense. What the error is telling you is to use https and not http in your URL.


#5

I did change the the url = ‘http://api.twitter.com/1.1/statuses/show.json?id=’ TO https://*etc and I got the same error again, so I thought there maybe something else I missed. I re-ran the script this morning with the suggested change and I’m now receiving error free tweets. Thank you for your help.