views:

68

answers:

2

Android twitter Trying the following tutorial for Oauth based authentication and updating user status.

http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html

When i run It has successfully authenticate but when it tries to update the status following error occur.

"twitter4j.TwitterException: SSL handshake failure: Failure in SSL library, usually a protocol error error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:585 0xaf589f78:0x00000000)"

any idea whats goin wrong ?

A: 

When i run this app on emulator i am using internet and behind proxy and thats why it is throwing exception, when i use direct connection it works fine, some thing bad with proxy i guess.

Faisal khan
A: 

You can use the below mentioned code to access network behind proxy using Emulator.

client = getHttpClient();
client.getCredentialsProvider().setCredentials(
      new AuthScope(null, -1, null), 
      new UsernamePasswordCredentials("Username", "Password"));
HttpHost httpproxy = new HttpHost("hostname", "portname", "http");
client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, httpproxy);
Amit Chintawar