title: How do you configure a Heroku Rack/Rails app to authenticate the client certificate of an incoming request?
body: <p>Say I have a Web service, called <em>JokeService</em>, which is a Rack/Rails3 app deployed on Heroku. And lets say I have an application, called <em>ComedyApp</em>. Now, I want <em>JokeService</em> to only entertain requests from <em>ComedyApp</em>. To do so, I would like <em>ComedyApp</em> to use a client certificate, which it uses to authenticate itself with <em>JokeService</em>.</p>
  
  <p>My question is, how the heck can I configure the <em>JokeService</em> (again, a Rack/Rails3 app on Heroku) to check the validity of the client certificate?</p>
  
  <p>This is related, but unanswered: <a href="https://stackoverflow.com/questions/7726182/how-to-access-ssl-client-certificate-from-rack-app">How to access SSL client certificate from rack app</a></p>