title: Rails 3.1 app running with SSL - TLS server name indication support error?
body: <p>I have a simple Rails 3.1.rc6 app that I'm using to try to test SSL configurations on my test server (OS X 10.7 Server). I'm using Phusion Passenger and Apache. </p>
  
  <p>I can run the app with no problem when not using SSL. When I enable SSL, either via Apache or via <code>config.force_ssl = true</code> in my <code>environments/production.rb</code> file, a page loads without an error, but it's mostly empty and it's not my site. It appears as if it's trying to serve files out of an empty directory.</p>
  
  <p>I checked the <a href="http://edgeguides.rubyonrails.org/configuring.html" rel="nofollow">Edge Rails Documentation for configuring SSL</a> and it only mentions adding the <code>config.force_ssl = true</code> option, saying that will automatically engage the Rack::SSL middleware.</p>
  
  <p>When I load the page, I'm seeing:</p>
  
  <pre><code>Index of /
  
      Name    Last modified   Size    Description
  
  Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8r DAV/2 Phusion_Passenger/3.0.8 Server at mysite.mydomain.com Port 443
  </code></pre>
  
  <p>The exact same thing happens if I remove the ssl config line in the rails app and use the Server tools to force the site to SSL (selecting a self-signed certificate for testing). What do I need to change to make it serve the <code>... myapp/current/public</code> folder, like it does when I have <code>config.force_ssl = false</code>?</p>
  
  <p>Edit: A little more information. I see the following in <code>/var/log/apache2/error_log</code>:</p>
  
  <pre><code>[Fri Aug 26 10:57:49 2011] [notice] caught SIGTERM, shutting down
  [Fri Aug 26 10:57:50 2011] [warn] RSA server certificate CommonName (CN) `My-Mac-mini.local' does NOT match server name!?
  ...
  [Fri Aug 26 10:57:50 2011] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
  httpd: Could not reliably determine the server's fully qualified domain name, using myserver.local for ServerName
  [Fri Aug 26 10:57:50 2011] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
  [Fri Aug 26 10:57:50 2011] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
  [Fri Aug 26 10:57:50 2011] [warn] RSA server certificate CommonName (CN) `My-Mac-mini.local' does NOT match server name!?
  ...
  [Fri Aug 26 10:57:50 2011] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
  [Fri Aug 26 10:57:50 2011] [notice] Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8r DAV/2 Phusion_Passenger/3.0.8 configured -- resuming normal operations
  cache: [GET /] miss
  </code></pre>