-
Notifications
You must be signed in to change notification settings - Fork 167
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 Sep 5, 2024
-
ssl: remove redundant ossl_ssl_ex_vcb_idx
The SSL ex_data index is used for storing the verify_callback Proc. The only user of it, ossl_ssl_verify_callback(), can find the callback by looking at the SSLContext object which is always known.
Configuration menu - View commit details
-
Copy full SHA for 3a3d6e2 - Browse repository at this point
Copy the full SHA 3a3d6e2View commit details -
ssl: remove unnecessary GetOpenFile() check in SSLSocket#syswrite*
Configuration menu - View commit details
-
Copy full SHA for 67587df - Browse repository at this point
Copy the full SHA 67587dfView commit details -
ssl: allow underlying socket to not implement #remote_address
The result value is 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 c19ff32 - Browse repository at this point
Copy the full SHA c19ff32View 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 a5ed9e6 - Browse repository at this point
Copy the full SHA a5ed9e6View commit details -
bio: add a BIO method that wraps IO-like object
Implement a minimal 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 This will be used in a later commit with OpenSSL::SSL::SSLSocket.
Configuration menu - View commit details
-
Copy full SHA for 0ff6d21 - Browse repository at this point
Copy the full SHA 0ff6d21View 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 supplied by a user application as long as it implements the necessary BIO functions. We can make our own BIO implementation ("BIO method") that wraps any Ruby IO-like object using normal Ruby method calls. Support for such an IO-like object is useful for establishing TLS connections on top of non-OS sockets, such as another TLS connection or an HTTP/2 tunnel. For 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 84ead32 - Browse repository at this point
Copy the full SHA 84ead32View commit details