ryanb / private_pub

Handle pub/sub messaging through private channels in Rails using Faye.
MIT License
864 stars 228 forks source link

/faye.js is not available over ssl #96

Closed tamvm closed 10 years ago

tamvm commented 10 years ago

I managed to enable SSL on my server with ryanb's guide at https://github.com/ryanb/private_pub#serving-faye-over-https-with-thin. But I can't connect to 4443 port to load faye.js. Here is some of my config:

config/private_pub.yml

production:
  server: "https://<my-website>:4443/faye"
  secret_token: "<%= ActiveSupport::SecureRandom.hex(32) %>"
  signature_expiration: 86400 # one day

config/private_pub_thin.yml


---
port: 4443
ssl: true
ssl_key_file: <ssl_key>.key
ssl_cert_file: <ssl_cert>.crt
environment: production
rackup: private_pub.ru
daemonize: true

Then start with following command:

bundle exec thin -C config/private_pub_thin.yml start

I dont understand why I can't connect to https://:4443/faye.js Is there anyone successfully setup private_pub over ssl?

Thanks a lot

gregmolnar commented 10 years ago

I am using private_pub with SSL and all works well. When you say you can't connect what does that mean? Is there any error message?

tamvm commented 10 years ago

Thanks a lot for quick reply. When I deployed with capistrano, the website worked normally, however in js console, it said that

GET https://<my-website>:4443/faye.js net::ERR_CONNECTION_REFUSED 

even, I managed to ssh and telnet to localhost 4443, the port isn't opened

telnet: Unable to connect to remote host: Connection refused

Did I make something wrong?

gregmolnar commented 10 years ago

Is port 4443 open? Maybe a firewall blocking it? Other than that it looks good to me.

tamvm commented 10 years ago

I have no idea to debug it. Do you have any suggestion but I am sure that the firewall blocking isn't a reason.

Thanks @gregmolnar

gregmolnar commented 10 years ago

Where do you host your app? Is it a VPS?

tamvm commented 10 years ago

Yes, I host on VPS

gregmolnar commented 10 years ago

Than check with your provider the firewall. If it is an amazon ec2 than you need to open that port for your security group: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html

tamvm commented 10 years ago

Thanks a lot for your link, I will check it now.

tamvm commented 10 years ago

Finally, I found the problem. I used ssh key file with pem pass phrase, I tried to run thin server, it requested me to enter pem pass phrase, so there's no way to enter the pem pass when I run as daemon. One quick solution here is that generating nopass ssl key file :)

Anyway, thanks @gregmolnar. I am closing this issue now

gregmolnar commented 10 years ago

I am glad you worked it out.