title: ssl, rails - Invalid request: Invalid HTTP format, parsing fails
body: <p>I used to be able to accept HTTPS requests in my local rails server, until after I restarted my machine today. I'm not sure if it's related to the restart or any updates that OSX might have done.</p>
  
  <p>rack says..</p>
  
  <pre><code>Completed 302 Found in 8ms (ActiveRecord: 0.9ms)
  Invalid request: Invalid HTTP format, parsing fails.
      /Users/martinverdejo/.rvm/gems/ruby-2.2.4@redfire/gems/thin-1.6.4/lib/thin/request.rb:84:in `execute'
  </code></pre>
  
  <p>I've tried exploring the solutions <a href="https://stackoverflow.com/questions/25614425/invalid-request-invalid-http-format-parsing-fails">here</a>. But the do not solve the problem.</p>
  
  <p>I tried exploring <a href="https://stackoverflow.com/a/30217654/1455717">this answer</a> in particular, running binding pry on thin, and I get a gibberish HTTP request generated. I'm not sure where that comes from:</p>
  
  <pre><code>\x16\x03\x01\x00\xA7\x01\x00\x00\xA3\x03\x02\x83#\x7FM\xBBxx\a\x91\xF7\xC3\x10\xF5\xFFq\x8E\xB2\xBD!\xED\x84\x99\xD6\xA4(\xC5\xE9*\x05\x87\xBF:\x00\x00\x10\xC0\n\xC0\x14\xC0\t\xC0\x13\x005\x00/\x00\nV\x00\x01\x00\x00j\xFF\x01\x00\x01\x00\x00\x00\x00\x1A\x00\x18\x00\x00\x15beta.127.0.0.1.xip.io\x00\x17\x00\x00\x00#\x00\x00\x00\x05\x00\x05\x01\x00\x00\x00\x003t\x00\x00\x00\x12\x00\x00\x00\x10\x00\x14\x00\x12\bspdy/3.1\bhttp/1.1uP\x00\x00\x00\v\x00\x02\x01\x00\x00\n\x00\b\x00\x06\x00\x1D\x00\x17\x00\x18
  </code></pre>
  
  <p>I'm using foreman, my Procfile looks like this.</p>
  
  <pre><code>web:    bundle exec rails server -p 3000
  search: bundle exec rake sunspot:solr:run
  </code></pre>
  
  <p>I tried changing that to the following but it still wontfix.</p>
  
  <pre><code>web:    bundle exec thin start -p 3000
  web:    bundle exec thin start -p 3001 --ssl
  search: bundle exec rake sunspot:solr:run
  </code></pre>
  
  <p>Any suggestions where else to look?</p>