hi

thank

Thank you. You are good man.
Thank you.

Well, i use the Twitter4j library that uses Java, I just installed the certificate on my application server, in my case Glassfish and all works well.

In PHP i do not know how to configure the app server for your app works, sorry for that.

I have a problem since last chage in twitter api. I made the changes in my code as is said in ‘Connecting to Twitter API using SSL’ doc but the response is always “Failed to validate oauth signature and token”, this are the parameters I send when i ask for the token: https://api.twitter.com/oauth/request_token
[request] =>
[oauth] => Array (
[oauth_consumer_key] => EDA7C3qIAgQLbVs6f5g4A
[oauth_token] =>
[oauth_nonce] => 82ba441695b0a2c3ad4c73e7a50ec104
[oauth_timestamp] => 1390229868
[oauth_signature_method] => HMAC-SHA1
[oauth_version] => 1.0
[oauth_callback] =>
[oauth_signature] => Y4YsYqthMqJjAXmqIaUBsHyR4Iw%3D )
[oauth_verifier] =>
[oauth_callback] =>
[oauth_token] => D6rKoj5NWXPHG4g0ySnEoN1VtBzStN1Z6PdWfsDTZtQ )

I use ‘cacert.pem’ from codebird lib because i didn’t found any other file to use.

Some idea about what is happening?

My twitter PHP apps have stopped working. Is this due to SSL or Oauth being changed?

My app doesn’t work width this certificate, anyone??

Announcements such as this should be made much further in advance. I don’t see anything before the discussion post less than five weeks before the change took effect. This is not sufficient time to allow developers to update their apps, especially when you take into account busy development schedules and submission time for native mobile applications.

The ability to subscribe to these updates via email would be especially helpful as well. I follow @twitterapi and have added the blog to my news reader, however I am more likely to actually capture an important message if received in an email.

How to update my certificates or how to install certificate? Is it instailled to jre or my pc? Thanks!

i am using this search api : http://api.twitter.com/1.1/search/tweets.json?q=harry&with_twitter_user_id=true&include_entities=1&include_rts=1

can anybody suggest me how to go for https?

I have installI right certificate,but it does not work.I use proxy server to request https.I get a problem like “unable to find valid certification path to requested target”.Is it because of proxy?
Second Problem is the application is android app,and how to use twitter4j to request https with ssl.Anyone know?

770071289

770071289

I had the same issue it worked locally but not on our app servers. I was getting below error

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certif
Relevant discussions can be found on the Internet at:

It worked for me after I have added below certificate to my keystore:

http://www.verisign.com/repository/roots/root-certificates/PCA-3G5.pem

Basically below is the command to be run under your JAVA_HOME/jre/lib/security and this will update your cacerts

http://gagravarr.org/writing/openssl-certs/others.shtml

keytool -import -alias verisignclass3g5 -file /home/verisignclass3g5.crt -keystore cacerts

wtf

Ooophs, we got an error: Authentification failed! Twitter returned an error. 401 Unauthorized. Is the reason the new Api Update from Twitter? I take the newest Version of HybridAuth
Here is the Code:

<?php /*! * HybridAuth * http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth * (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html */ /** * Hybrid_Providers_Twitter provider adapter based on OAuth1 protocol */ class Hybrid_Providers_Twitter extends Hybrid_Provider_Model_OAuth1 { /** * IDp wrappers initializer */ function initialize() { parent::initialize(); // Provider api end-points $this->api->api_base_url = "https://api.twitter.com/1.1/"; $this->api->authorize_url = "https://api.twitter.com/oauth/authenticate"; $this->api->request_token_url = "https://api.twitter.com/oauth/request_token"; $this->api->access_token_url = "https://api.twitter.com/oauth/access_token"; if ( isset( $this->config['api_version'] ) && $this->config['api_version'] ){ $this->api->api_base_url = "https://api.twitter.com/{$this->config['api_version']}/"; } if ( isset( $this->config['authorize'] ) && $this->config['authorize'] ){ $this->api->authorize_url = "https://api.twitter.com/oauth/authorize"; } $this->api->curl_auth_header = false; } /** * begin login step */ function loginBegin() { $tokens = $this->api->requestToken( $this->endpoint ); // request tokens as recived from provider $this->request_tokens_raw = $tokens; // check the last HTTP status code returned if ( $this->api->http_code != 200 ){ throw new Exception( "Authentification failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ), 5 ); } if ( ! isset( $tokens["oauth_token"] ) ){ throw new Exception( "Authentification failed! {$this->providerId} returned an invalid oauth token.", 5 ); } $this->token( "request_token" , $tokens["oauth_token"] ); $this->token( "request_token_secret", $tokens["oauth_token_secret"] ); // redirect the user to the provider authentication url with force_login if ( isset( $this->config['force_login'] ) && $this->config['force_login'] ){ Hybrid_Auth::redirect( $this->api->authorizeUrl( $tokens, array( 'force_login' => true ) ) ); } // else, redirect the user to the provider authentication url Hybrid_Auth::redirect( $this->api->authorizeUrl( $tokens ) ); } /** * load the user profile from the IDp api client */ function getUserProfile() { $response = $this->api->get( 'account/verify_credentials.json' ); // check the last HTTP status code returned if ( $this->api->http_code != 200 ){ throw new Exception( "User profile request failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ), 6 ); } if ( ! is_object( $response ) || ! isset( $response->id ) ){ throw new Exception( "User profile request failed! {$this->providerId} api returned an invalid response.", 6 ); } # store the user profile. $this->user->profile->identifier = (property_exists($response,'id'))?$response->id:""; $this->user->profile->displayName = (property_exists($response,'screen_name'))?$response->screen_name:""; $this->user->profile->description = (property_exists($response,'description'))?$response->description:""; $this->user->profile->firstName = (property_exists($response,'name'))?$response->name:""; $this->user->profile->photoURL = (property_exists($response,'profile_image_url'))?$response->profile_image_url:""; $this->user->profile->profileURL = (property_exists($response,'screen_name'))?("http://twitter.com/".$response->screen_name):""; $this->user->profile->webSiteURL = (property_exists($response,'url'))?$response->url:""; $this->user->profile->region = (property_exists($response,'location'))?$response->location:""; return $this->user->profile; } /** * load the user contacts */ function getUserContacts() { $parameters = array( 'cursor' => '-1' ); $response = $this->api->get( 'friends/ids.json', $parameters ); // check the last HTTP status code returned if ( $this->api->http_code != 200 ){ throw new Exception( "User contacts request failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ) ); } if( ! $response || ! count( $response->ids ) ){ return ARRAY(); } // 75 id per time should be okey $contactsids = array_chunk ( $response->ids, 75 ); $contacts = ARRAY(); foreach( $contactsids as $chunk ){ $parameters = array( 'user_id' => implode( ",", $chunk ) ); $response = $this->api->get( 'users/lookup.json', $parameters ); // check the last HTTP status code returned if ( $this->api->http_code != 200 ){ throw new Exception( "User contacts request failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ) ); } if( $response && count( $response ) ){ foreach( $response as $item ){ $uc = new Hybrid_User_Contact(); $uc->identifier = (property_exists($item,'id'))?$item->id:""; $uc->displayName = (property_exists($item,'name'))?$item->name:""; $uc->profileURL = (property_exists($item,'screen_name'))?("http://twitter.com/".$item->screen_name):""; $uc->photoURL = (property_exists($item,'profile_image_url'))?$item->profile_image_url:""; $uc->description = (property_exists($item,'description'))?$item->description:""; $contacts[] = $uc; } } } return $contacts; } /** * update user status */ function setUserStatus( $status ) { $parameters = array( 'status' => $status ); $response = $this->api->post( 'statuses/update.json', $parameters ); // check the last HTTP status code returned if ( $this->api->http_code != 200 ){ throw new Exception( "Update user status failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ) ); } } /** * load the user latest activity * - timeline : all the stream * - me : the user activity only * * by default return the timeline */ function getUserActivity( $stream ) { if( $stream == "me" ){ $response = $this->api->get( 'statuses/user_timeline.json' ); } else{ $response = $this->api->get( 'statuses/home_timeline.json' ); } // check the last HTTP status code returned if ( $this->api->http_code != 200 ){ throw new Exception( "User activity stream request failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ) ); } if( ! $response ){ return ARRAY(); } $activities = ARRAY(); foreach( $response as $item ){ $ua = new Hybrid_User_Activity(); $ua->id = (property_exists($item,'id'))?$item->id:""; $ua->date = (property_exists($item,'created_at'))?strtotime($item->created_at):""; $ua->text = (property_exists($item,'text'))?$item->text:""; $ua->user->identifier = (property_exists($item->user,'id'))?$item->user->id:""; $ua->user->displayName = (property_exists($item->user,'name'))?$item->user->name:""; $ua->user->profileURL = (property_exists($item->user,'screen_name'))?("http://twitter.com/".$item->user->screen_name):""; $ua->user->photoURL = (property_exists($item->user,'profile_image_url'))?$item->user->profile_image_url:""; $activities[] = $ua; } return $activities; } }

Ooophs, we got an error: Authentification failed! Twitter returned an error. 401 Unauthorized. Is the reason the new api update from Twitter? I take the OpenSource Project HybridAuth

Im still getting 401 error when try to request_token. Im using PHP. Anybody could fix this issue?

Thanks

I am getting error code 400 when used ssl connections. I am using twiiter4j-3.0.3 library. Can somebody give me some suggestions what is wrong here?

Code Examples for java?