Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

em-websocket wont connect over SSL #142

Open
stoivo opened this issue Sep 21, 2016 · 0 comments
Open

em-websocket wont connect over SSL #142

stoivo opened this issue Sep 21, 2016 · 0 comments

Comments

@stoivo
Copy link

stoivo commented Sep 21, 2016

em-websocket wont connect over SSL

When trying to connect on secure => false connection is working perfectly
but when we try to include tls_options and set secure to true.
server just wont start.
The EventMachine start but EventMachine::WebSocket start boot and get terminated, but EventMachine is still running as a ruby process. What I mean is that I can find it by running ps aux | grep ruby.

This is the STDOUT we get when we start the process.

Server started
Terminating WebSocket Server

We are using Ruby on rails , nginx server & Ubuntu 12.04, but we don't think that have any thing to do with this issue.

We are using Ruby 2.2.2
eventmachine (1.2.0.1)
em-websocket (0.5.1)

for testing purposes we are using letsencrypt for certificates
When we setup ssl for https we added these lines to nginx.conf

ssl_certificate /etc/letsencrypt/live/domain/fullchain.pem;
ssl_certificate_key    /etc/letsencrypt/live/domain/privkey.pem;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

This is the websocket script

require 'em-websocket'

EventMachine.run {
  EventMachine::WebSocket.start(
    :host => "0.0.0.0",
    :port => 8080,
    :debug => true,
    :secure => true,
    :tls_options => {
      :private_key_file => "/etc/letsencrypt/live/domain/privkey.pem",
      :cert_chain_file => "/etc/letsencrypt/live/domain/cert.pem",
      :cipher_list => "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"
    }
  ) do |ws|
   puts "Sterting Websocket"
   ws.onopen { |connection|
      puts "onOpen"
    }
  end

  puts "Server started"
}

Thanks for looking at this :)
Open issue on eventmachine/eventmachine#733 also, not sure where it belong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant