title: Foursquare & Heroku: certificate verify failed
body: <p>I obtained a key/secret for userless access at the foursquare developer site and now I want to fetch data with the use of the <code>foursquare2</code> gem:</p>
  
  <pre><code>    @foursquare = Foursquare2::Client.new(:client_id =&gt; 'xxx', :client_secret =&gt; 'yyy')
  </code></pre>
  
  <p>This works fine on localhost but on Heroku I get the following error:</p>
  
  <pre><code>ActionView::Template::Error (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed)
  </code></pre>
  
  <p>I didn't set up any SSL or Omniauth within the app.</p>
  
  <p><strong>Update:</strong> Found the solution! You have to pass in a ssl hash with the path to heroku's certificates path.</p>
  
  <pre><code>@foursquare = Foursquare2::Client.new(:client_id =&gt; 'xxx',
                                        :client_secret =&gt; 'yyy',
                                        :ssl =&gt; { :verify =&gt; OpenSSL::SSL::VERIFY_PEER, :ca_file =&gt; '/usr/lib/ssl/certs/ca-certificates.crt' })
  </code></pre>