EventMachine, OpenSSL, and Windows

133 views
Skip to first unread message

aw...@redhat.com

unread,
Oct 28, 2016, 3:09:56 PM10/28/16
to EventMachine
Hello,

I'm working on a feature (https://github.com/jekyll/jekyll/pull/5142) for the Jekyll static site generator.  I'm using EventMachine to run a WebSockets server (em-websockets).  Unfortunately, I'm having an issue with eventmachine's native extensions on Windows in the Jekyll CI environment.  I'm getting an error, "Encryption not available on this event-machine".  I've read https://github.com/eventmachine/eventmachine/wiki/Building-EventMachine and I believe I'm linking to OpenSSL and getting the native extensions compiled but I am still seeing the same error:


bundle exec gem pristine eventmachine
Restoring gems to pristine condition...
Restored eventmachine-1.2.0.1-x86-mingw32
bundle exec gem install eventmachine --platform ruby -- --with-ssl-dir=C:/OpenSSL-%OPENSSL_ARCH%
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-ssl-dir=C:/OpenSSL-Win32'
This could take a while...
Successfully installed eventmachine-1.2.0.1
Parsing documentation for eventmachine-1.2.0.1
Installing ri documentation for eventmachine-1.2.0.1
Done installing documentation for eventmachine after 7 seconds
1 gem installed
ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]
gem --version
2.6.7
bundler --version
Bundler version 1.13.3
bash ./script/cibuild
+ ruby -S bundle exec rake TESTOPTS=--profile test
C:/Ruby23/bin/ruby.exe -w -I"lib;lib;test" -I"C:/projects/jekyll/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/lib" "C:/projects/jekyll/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/lib/rake/rake_test_loader.rb" "test/**/test_*.rb" --profile
terminate called after throwing an instance of 'std::runtime_error'
what(): Encryption not available on this event-machine
rake aborted!
Command failed with status (3): [ruby -w -I"lib;lib;test" -I"C:/projects/jekyll/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/lib" "C:/projects/jekyll/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/lib/rake/rake_test_loader.rb" "test/**/test_*.rb" --profile]

As you can see, after a `bundle install`, I'm running `bundle pristine` and then `bundle exec gem install` with the appropriate flags as mentioned in the wiki article I linked earlier.  Using `bundler config` to add the arguments did not seem to make an difference at all for me.  In addition to the log reporting that the native extensions are built, I can also see an `ssl.o` file in the `ext` directory of the evenmachine gem.

If anyone has any additional insight into what "Encryption not available on this event-machine" means or if there's a better way to tell if eventmachine linked successfully to OpenSSL, I'd appreciate some help!
----------
Regards,
Alex

Alex Wood

unread,
Oct 28, 2016, 3:09:56 PM10/28/16
to EventMachine
Hi,

I'm trying to get a feature merged into Jekyll, a static blog generation program.  The feature (https://github.com/jekyll/jekyll/pull/5142) adds a WebSockets server based on EventMachine that will push live reloads to a user's browser so they can get near real-time previews.

Unfortunately, I'm having a great deal of trouble getting the unit tests to run in the Jekyll teams' Appveyor CI environment.  The issue I'm encountering, "Encryption not available on this event-machine", seems due to the EventMachine gem being installed on Appveyor not being linked to OpenSSL (Based on the wiki article at https://github.com/eventmachine/eventmachine/wiki/Building-EventMachine-with-SSL-on-Windows), but I am having the hardest time fixing it. 

The Appveyor environment I'm using has OpenSSL available (compiled under both 32 and 64 bit).  My solution was to `gem pristine` the eventmachine pulled down with bundler and recompile it linked to the OpenSSL directory like so:

bundle exec gem pristine eventmachine
bundle exec gem install eventmachine --platform ruby -- --with-ssl-dir=C:/OpenSSL-%OPENSSL_ARCH%

That did not work and I'm getting the following output:

bundle exec gem install eventmachine --platform ruby -- --with-ssl-dir=C:/OpenSSL-%OPENSSL_ARCH%
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-ssl-dir=C:/OpenSSL-Win32'
This could take a while...
Successfully installed eventmachine-1.2.0.1
Parsing documentation for eventmachine-1.2.0.1
Installing ri documentation for eventmachine-1.2.0.1
Done installing documentation for eventmachine after 7 seconds
1 gem installed
ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]
gem --version
2.6.7
bundler --version
Bundler version 1.13.3
bash ./script/cibuild
+ ruby -S bundle exec rake TESTOPTS=--profile test
C:/Ruby23/bin/ruby.exe -w -I"lib;lib;test" -I"C:/projects/jekyll/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/lib" "C:/projects/jekyll/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/lib/rake/rake_test_loader.rb" "test/**/test_*.rb" --profile
terminate called after throwing an instance of 'std::runtime_error'
what(): Encryption not available on this event-machine

I did not have any luck at all using a `bundle config` command to set `--with-ssl-dir` so the above method has gotten me farther than anything else I've tried since at least I see the native extensions being compiled and I can see the ssl.o file in the `ext` directory.

If anyone has an ideas on how exactly to deal with this linking issue, I would certainly appreciate some help.  I am pretty much a novice when it comes to development in a Windows environment.
------
Regards,
Alex

James Tucker

unread,
Oct 28, 2016, 3:12:18 PM10/28/16
to eventm...@googlegroups.com
I'd recommend you use faye websockets and puma, then you won't need EventMachine.

--
You received this message because you are subscribed to the Google Groups "EventMachine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eventmachine+unsubscribe@googlegroups.com.
To post to this group, send email to eventm...@googlegroups.com.
Visit this group at https://groups.google.com/group/eventmachine.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages