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
ssl: support IO-like object as the underlying transport #736
base: master
Are you sure you want to change the base?
Commits on Mar 23, 2024
-
bio: add a BIO method that wraps IO-like object
Implement a minimum BIO_METHOD required for SSL/TLS. The underlying IO-like object must implement the following methods: - #read_nonblock(len, exception: false) - #write_nonblock(str, exception: false) - #flush The IO-like object is also required to implement several other methods to function in a later commit in this series.
Configuration menu - View commit details
-
Copy full SHA for cd12c60 - Browse repository at this point
Copy the full SHA cd12c60View commit details -
ssl: remove unnecessary GetOpenFile() check in SSLSocket#syswrite*
Configuration menu - View commit details
-
Copy full SHA for 41661db - Browse repository at this point
Copy the full SHA 41661dbView commit details -
ssl: allow underlying socket to not implement #remote_address
The result value is only used for generating an informative error message. Let's just say "unsupported" if it's not available.
Configuration menu - View commit details
-
Copy full SHA for 1eb4b57 - Browse repository at this point
Copy the full SHA 1eb4b57View commit details -
ssl: allow underlying socket to not implement #sync
The value is used to determine whether SSLSocket should skip buffering in OpenSSL::Buffering or not. Defaulting to true (no buffering) should be a safe option.
Configuration menu - View commit details
-
Copy full SHA for 2a83105 - Browse repository at this point
Copy the full SHA 2a83105View commit details -
ssl: support IO-like object as the underlying transport
OpenSSL::SSL::SSLSocket currently requires a real IO (socket) object because it passes the file descriptor to OpenSSL. OpenSSL internally uses an I/O abstraction layer called BIO to interact with the underlying socket. BIO is pluggable; the implementation can be provided by a user application. It's possible to implement our own BIO implementation ("BIO method") that wraps any Ruby IO-like object. Let's do it. This allows establishing a TLS connection on top of another TLS connection. For the performance reason, this patch continues to use the original socket BIO if the user passes a real IO object.
Configuration menu - View commit details
-
Copy full SHA for ef6508f - Browse repository at this point
Copy the full SHA ef6508fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d725420 - Browse repository at this point
Copy the full SHA d725420View commit details -
Configuration menu - View commit details
-
Copy full SHA for ded7cb0 - Browse repository at this point
Copy the full SHA ded7cb0View commit details