Amazon EC2 and eventmachine encryption issues

0

0

I'm testing out an Amazon EC2 instance (Amazon Linux AMI 2011.09, EBS boot, 32-bit architecture with Amazon EC2 AMI Tools.) to see if it'll serve my purposes.

I've written a small backend in Ruby (which runs great on my Mac), using eventmachine and em-http-request.

When I try to run this on the EC2 instance, I get the following error:

what(): Encryption not available on this event-machine

I'm pretty sure this has something to do with the em-http-request, because I get a log output which is just before a https request.

I've read online it something to do with event-machine linking to openssl properly and I'm wondering how I should do that?

At the moment, I'm installing the dev tools with:

sudo yum groupinstall "Development Tools"

Ruby:

sudo yum install ruby-devel

I'm then installing rubygems with this:

wget http://...rubygems.1.8.15.tgz

tar -xvf rubygems.1.8.15

cd rubygems.1.8.15

ruby setup.rb

Installing the gems:

sudo gem install eventmachine

sudo gem install em-http-request

This all seems to work just fine, no errors so far. The error comes when I attempt to run the ruby file.

Any ideas?

Tom Irving

Posted 2012-01-15T22:04:46.270

Reputation: 3

Have you installed libssl-dev, and was eventmachine compiled without -DWITHOUT_SSL ? – harrymc – 2012-01-18T10:48:38.507

When I attempt to download libssl-dev(el) with yum install, I just get a message that there's no such package. I don't know how eventmachine was compiled, I'm getting it directly from the gems install command. Can I check somehow? – Tom Irving – 2012-01-19T11:01:14.040

I do not use this software, but I found this eventmachine 0.12.8 release note which says "EM.ssl? will check if the reactor was built with ssl support". This thread suggests if EM.ssl? puts "yes" else puts "no" end. If you get "no" then you need to compile your own eventmachine.

– harrymc – 2012-01-19T11:29:44.160

Yup, it outputs no. So how do I compile eventmachine with SSL support? As I mentioned before, I can't find libssl-dev(el) to install, I just get an error: "No package libssl-devel available" – Tom Irving – 2012-01-19T13:55:04.870

Answers

0

I do not use this software, but I found this eventmachine 0.12.8 release note which says:

EM.ssl? will check if the reactor was built with ssl support

This thread suggests the following code :

EM.ssl?
  puts "yes"
else
  puts "no"
end

If you get "no" then you need to compile your own eventmachine, or use another release.

harrymc

Posted 2012-01-15T22:04:46.270

Reputation: 306 093

0

Turns out the pre-release EventMachine supports SSL with no additional steps.

It can be installed with:

gem install eventmachine --pre

Make sure you remove the old EventMachine as well, otherwise it's used instead.

Tom Irving

Posted 2012-01-15T22:04:46.270

Reputation: 3

I converted my comments into an answer. You won't be able to use a pre-release forever, so better work on convincing the developers to compile without -DWITHOUT_SSL. – harrymc – 2012-01-19T18:31:27.357

I've marked yours as the accepted answer and yeah, hopefully I can convince them. Is there any disadvantage to compiling with SSL that I might be overlooking? – Tom Irving – 2012-01-19T23:36:37.827

The only possible disadvantage is that the latest version configured with SSL was not tested by the developers. According to the thread I found, it worked fine for at least one person. In any case, you will find out soon enough whether it works or not, and could include that fact in your post on their forums. Just remember that version 0.x means that EventMachine is still in alpha or beta-testing. – harrymc – 2012-01-20T07:03:38.107