Ruby Interpreter crashes if I run Faye with SSL option

306 views
Skip to first unread message

anil kumar

unread,
Jun 17, 2013, 7:35:11 AM6/17/13
to faye-...@googlegroups.com

require 'faye'
Faye::WebSocket.load_adapter('thin')
Faye::Logging.log_level = :debug

bayeux = Faye::RackAdapter.new(
  :mount => '/faye',
  :timeout => 60,
  :engine => { :timeout => 60 * 10 } )

bayeux.listen(
   8443,
   :key => 'C:/Documents and Settings/anikumar/Desktop/FayeTest/server.key',
   :cert => 'C:/Documents and Settings/anikumar/Desktop/FayeTest/server.crt'
)

Above is my server code, I am running it using "thin start -R faye.ru" or "ruby faye.ru -s thin --ssl" command, server starts perfectally. But whenever I hit the "https://localhost:8443/faye.js" in my browser, faye server crashes with Ruby crash and give usual windows Send/Don't Send dialog box.

Any help is highly appreciated.

Also I tried the following server code, but result is same (Ruby Interpreter crash):

Faye::WebSocket.load_adapter('thin')
Faye::Logging.log_level = :debug

bayeux = Faye::RackAdapter.new(
  :mount => '/faye',
  :timeout => 60
 )

  EM.run {
    thin = Rack::Handler.get('thin')
    thin.run(bayeux , :Port => 8443) do |server|
        server.ssl_options = {
          :private_key_file => 'server.key',
          :cert_chain_file  => 'server.crt'
        }
        server.ssl = true
    end
  }


Regards,
Anil

James Coglan

unread,
Jun 17, 2013, 7:44:01 AM6/17/13
to faye-...@googlegroups.com
On 17 June 2013 12:35, anil kumar <anilku...@gmail.com> wrote:

require 'faye'
Faye::WebSocket.load_adapter('thin')
Faye::Logging.log_level = :debug

bayeux = Faye::RackAdapter.new(
  :mount => '/faye',
  :timeout => 60,
  :engine => { :timeout => 60 * 10 } )

bayeux.listen(
   8443,
   :key => 'C:/Documents and Settings/anikumar/Desktop/FayeTest/server.key',
   :cert => 'C:/Documents and Settings/anikumar/Desktop/FayeTest/server.crt'
)

Above is my server code, I am running it using "thin start -R faye.ru" or "ruby faye.ru -s thin --ssl" command, server starts perfectally. But whenever I hit the "https://localhost:8443/faye.js" in my browser, faye server crashes with Ruby crash and give usual windows Send/Don't Send dialog box.

Don't use bayeux.listen(), it is deprecated. Just put `run bayeux` in your faye.ru file, and pass the SSL options using the `thin` command-line. 

anil kumar

unread,
Jun 17, 2013, 7:58:02 AM6/17/13
to faye-...@googlegroups.com
Tried thin start -R faye.ru --ssl  --ssl-key-file "server.key"  --ssl-cert-file "server.crt"  --ssl-verify -p 8443
Same crash is happening. May be I am not putting correct Thin SSL options.

James Coglan

unread,
Jun 17, 2013, 8:39:15 AM6/17/13
to faye-...@googlegroups.com
On 17 June 2013 12:58, anil kumar <anilku...@gmail.com> wrote:
Tried thin start -R faye.ru --ssl  --ssl-key-file "server.key"  --ssl-cert-file "server.crt"  --ssl-verify -p 8443
Same crash is happening. May be I am not putting correct Thin SSL options.

Have you tried running a different app like this to see if the problem is with Thin or the app itself? 

anil kumar

unread,
Jun 18, 2013, 6:36:42 AM6/18/13
to faye-...@googlegroups.com
HI, 
Now I am able to solve the problem. Problem was my Ruby. I  was using MSVC Ruby and I am guessing it did not have TSL/SSL support.
Once I tried with MIngW Ruby, things started working.
Reply all
Reply to author
Forward
0 new messages