title: codebird-php Twitter app. Error 77 while validating the Twitter API certificate
body: <p>I'm trying to make a basic app which authenticates with Twitter, and posts a message on a user's behalf via the library codebird-php (<a href="https://github.com/mynetx/codebird-php">https://github.com/mynetx/codebird-php</a>)</p>
  
  <p>I have copypasted the example code shown on the readme, and changed YOURKEY and YOURSECRET with my app's key and secret.</p>
  
  <p>Everything should work fine but when I load my page, I get a message saying : 
  Error 77 while validating the Twitter API certificate.</p>
  
  <p>I can't find this error type anywhere on google... The meaning is quite obvious but I have no idea how to solve it. Any thoughts?</p>
  
  <p>Code is as follows : </p>
  
  <pre><code>require_once ('codebird.php');
  \Codebird\Codebird::setConsumerKey('YOURKEY', 'YOURSECRET'); // I changed it to my   settings
  
  $cb = \Codebird\Codebird::getInstance();
  session_start();
  
  if (! isset($_SESSION['oauth_token'])) {
  // get the request token
  $reply = $cb-&gt;oauth_requestToken(array(
      'oauth_callback' =&gt; 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']
  ));
  
  // store the token
  $cb-&gt;setToken($reply-&gt;oauth_token, $reply-&gt;oauth_token_secret);
  $_SESSION['oauth_token'] = $reply-&gt;oauth_token;
  $_SESSION['oauth_token_secret'] = $reply-&gt;oauth_token_secret;
  $_SESSION['oauth_verify'] = true;
  
  // redirect to auth website
  $auth_url = $cb-&gt;oauth_authorize();
  header('Location: ' . $auth_url);
  die();
  
  } elseif (isset($_GET['oauth_verifier']) &amp;&amp; isset($_SESSION['oauth_verify'])) {
  // verify the token
  $cb-&gt;setToken($_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
  unset($_SESSION['oauth_verify']);
  
  // get the access token
  $reply = $cb-&gt;oauth_accessToken(array(
      'oauth_verifier' =&gt; $_GET['oauth_verifier']
  ));
  
  // store the token (which is different from the request token!)
  $_SESSION['oauth_token'] = $reply-&gt;oauth_token;
  $_SESSION['oauth_token_secret'] = $reply-&gt;oauth_token_secret;
  
  // send to same URL, without oauth GET parameters
  header('Location: ' . basename(__FILE__));
  die();
  }
  
  // assign access token on each page load
  $cb-&gt;setToken($_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
  </code></pre>