Verified Certificate with thin server
Check thin version, in older version this was the issue https://github.com/macournoyer/thin/issues/244
Chrome asks to "Select a Certificate" for SSL on my Rails app using thin
They have resolved it in new version https://rubygems.org/gems/thin/versions/2.0.0.pre
How can I have a clean output with thin and ssl?
When launching Thin with the command:
rails server thin
The possible options are propagated from Rack to thin in Rack::Server#start:
server.run wrapped_app, options
But in Rack::Handler::Thin#run, we can see that the handler doesn't use those options:
module Rack
module Handler
class Thin
def self.run(app, options={})
app = Rack::Chunked.new(Rack::ContentLength.new(app))
server = ::Thin::Server.new(options[:Host] || '0.0.0.0',
options[:Port] || 8080,
app)
yield server if block_given?
server.start
end
end
end
end
When using Thin in ssl mode via the command line:
thin start --ssl
Options are parsed in Thin::Runner#parser and then used in Controllers::Controller#start
I would suggest to monkey patch Rack::Handler::Thin#run with a content similar to Controllers::Controller#start.
The result would be something like this:
module Rack
module Handler
class Thin
def self.run(app, options={})
app = Rack::Chunked.new(Rack::ContentLength.new(app))
server = ::Thin::Server.new(options[:Host] || '0.0.0.0',
options[:Port] || 8080,
app)
server.ssl = true
server.ssl_options = { :private_key_file => PATH_TO_KEY_FILE, :cert_chain_file => PATH_TO_CERT_FILE }
yield server if block_given?
server.start
end
end
end
end
Rails app accessible from LAN machine using IP address, but not Bonjour name?
Problem solved.
I'm using Snow Leopard and disabling IPv6 was all that was required for it to work it would seem.
Also of note, publishing the service was not required, mainly because it didn't need to be discovered.
Related Topics
Rails Cannot Find Model with Same Name as Ruby Class
How to Serialize as Activesupport::Hashwithindifferentaccess Anymore
Passing Variables on the Command Line to a Cucumber Test
While Executing Gem ... (Argumenterror) Unknown Encoding Name - Cp720
How to Make Empty Tags Self-Closing with Nokogiri
Disabling Irb Autocomplete on Heroku
Algorithm to Shuffle an Array Randomly Based on Different Weights
Chrome Asks to "Select a Certificate" for Ssl on My Rails App Using Thin
Rails 4 Wysiwyg Bootsy Not Displaying Formatting
Failing to Enable User-Env-Compile on Heroku
Can a Ruby Module Be Described as a Singleton Class
How to Emit Yaml in Ruby Expanding Aliases
Execute Code Once Sinatra Server Is Running
Ruby on Rails Workflow Engine (Like Ibm Workflow)
How to Download File from Google Drive API with Service Account
When Should I Use Datetime VS Date, Time Fields in Ruby/Rails