Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Ruby 1.9.3 #7

Open
Sharpie opened this issue Apr 14, 2015 · 2 comments
Open

Support Ruby 1.9.3 #7

Sharpie opened this issue Apr 14, 2015 · 2 comments

Comments

@Sharpie
Copy link
Owner

Sharpie commented Apr 14, 2015

SSL connection tracing is currently implemented via TracePoint which is only present on Ruby 2.0 and newer. Ruby 1.9.3 could be supported by creating an alternate implementation based on set_trace_func.

@Sharpie
Copy link
Owner Author

Sharpie commented Apr 15, 2015

After poking around a bit, this may actually be difficult to do.

One nice thing about TracePoint, aside from being able to declare multiple instances, is that the current object is available via the tp.self method. On the other hand, set_trace_func only exposes the current binding. Since SSLSocket#connect is a C method, there doesn't seem to be a way of acquiring a reference to the socket that connected via the binding :(

@Sharpie
Copy link
Owner Author

Sharpie commented Apr 15, 2015

One thought: Fall back to monkeypatching.

Instead of trying to make set_trace_point work, just re-factor the SSLkeylog::OpenSSL module so that it can be included by OpenSSL::SSLSocket in a way that overrides the connect method. This sort of approach won't be targetable or reversible, but may be "good enough" for 1.9.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant