Created
November 17, 2014 13:15
-
-
Save ik5/027beeacaf4a1a4483bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fiddle' | |
openssl = Fiddle.dlopen('/usr/lib/libssl.so') | |
SSL_library_init = Fiddle::Function.new( | |
openssl['SSL_library_init'], | |
[], | |
Fiddle::TYPE_INT | |
) | |
SSL_library_init.call # no parameters so no () requires | |
# => 1 | |
SSL_load_error_string = Fiddle::Function.new( | |
openssl['SSL_load_error_strings'], | |
[], | |
Fiddle::TYPE_LONG | |
) | |
SSL_load_error_string.call | |
# => 139941785269192 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, so now we have a ruby to C to ruby to SSL wrapper XD