-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
205 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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