Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was able to successfully get the debugging working with ssl enabled thin, using the solution suggested by nathan. Though I had to do one small change of deferring initialization of @ssl after the call of initialize_without_ssl (an alias method for the original TcpServer's initialize)</p> <pre><code>require 'thin' module Thin module Backends TcpServer.class_eval do def initialize_with_SSL(host, port) if Rails.env.development? Rails.logger.info "Loading SSL certs from ./ssl_dev..." @ssl_options = { :private_key_file =&gt; File.expand_path("../../ssl_dev/server.key", __FILE__), :cert_chain_file =&gt; File.expand_path("../../ssl_dev/server.crt", __FILE__), :verify_peer =&gt; nil } end initialize_without_SSL(host, port) # @ssl initialized after calling the original initialize of TcpServer @ssl = true if Rails.env.development? end alias_method :initialize_without_SSL, :initialize alias_method :initialize, :initialize_with_SSL end end end alias_method :initialize_without_SSL, :initialize alias_method :initialize, :initialize_with_SSL end </code></pre> <p>In the above code snippett, @ssl is set to true after calling the original initialize call of Thin::Backend::TcpServer. I had to do this since the TcpServer invokes its parent's initialize (Thin::Backend:Base) that sets the @ssl to nil</p> <pre><code> #Base initialize method. Thin gem version 1.5.0 def initialize @connections = [] @timeout = Server::DEFAULT_TIMEOUT @persistent_connection_count = 0 @maximum_connections = Server::DEFAULT_MAXIMUM_CONNECTIONS @maximum_persistent_connections = Server::DEFAULT_MAXIMUM_PERSISTENT_CONNECTIONS @no_epoll = false @ssl = nil @threaded = nil end </code></pre> <p>As noted in nathan's code block, the whole solution appears to be a hack around. In my opinion, I am fine with the snippet considering the code is done within the context of env.development and most importantly it allows debugging with ssl enabled.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload