0

i am trying to get the authtoken using twitter 4j i put it in try and catch but it catches always this error twitter4j.TwitterException: Not trusted server certificate here it is my function

public String BeginAuthorization()
    {
        try
        {
            if(null==currentRequestToken)
            {
                currentRequestToken=twitter.getOAuthRequestToken();
            }
            return currentRequestToken.getAuthorizationURL();
        }
        catch (TwitterException e) {
            // TODO: handle exception
            e.printStackTrace();
        }
        return null;
    }
user1115684
  • 75
  • 1
  • 11

1 Answers1

0

I have figure it out i changed the emulator i was running on 2.1 i changed to 2.2 then i added this line System.setProperty("twitter4j.http.useSSL", "false"); before making an instance of twitter and it works

Praveenkumar
  • 24,084
  • 23
  • 95
  • 173
user1115684
  • 75
  • 1
  • 11