sensu/sensu-em — pull request #5 by ayan4m1 (2014-09-14 06:47:17+00:00)
Title: Windows SSL support

Since https://github.com/sensu/sensu-em/commit/5baa3d1b3dba06d131709355bfe74e7019e5b7ff, the Windows sensu-client will log the following error if ``ssl`` is set to ``true`` in the rabbitmq configuration:

```
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0/lib/em/connection.rb:419:in `set_tls_parms': wrong number of arguments (6 for 4) (ArgumentError)
```

This is reported at https://groups.google.com/forum/#!topic/sensu-users/EICgMH9V4Qk and has been reported on IRC.

Out of the box, sensu-em will not build on Windows x64 because the OpenSSL lib/include paths are not found and because the wrapper C++ code contains a cast that results in an error when run through MinGW g++.

Using the latest OpenSSL package from Luis Lavena (http://packages.openknapsack.org/openssl/openssl-1.0.0i-x64-windows.tar.lzma) I can build the sensu-em gem with native OpenSSL support. However, this requires a native code change to resolve a compile error because ``unsigned long`` is not a safe type to use for a 64-bit pointer. I was also able to simplify ``extconf.rb`` slightly because the openknapsack package uses the same library names as its Linux counterparts.

This does add a hardcoded path - originally I had made this configurable by adding a Gem called ``pkg-config`` and modifying the ``openssl.pc`` file in the openknapsack package. All told, it ended up requiring a lot of config to avoid a single hardcoded path - I'd look for feedback on what makes more sense there.

I have tested building and installing the ``sensu-em`` gem on Windows 8.1, Server 2008, and 2012 (all 64-bit). I have also built and installed the gem in debian jessie.

Environment setup instructions are available at https://gist.github.com/ayan4m1/591c83edb9c38e219acf