Add Kernel TLS support to custom OpenSSL::BIO#16646
Merged
straight-shoota merged 10 commits intocrystal-lang:masterfrom Feb 28, 2026
Merged
Add Kernel TLS support to custom OpenSSL::BIO#16646straight-shoota merged 10 commits intocrystal-lang:masterfrom
OpenSSL::BIO#16646straight-shoota merged 10 commits intocrystal-lang:masterfrom
Conversation
ac4a676 to
89ab94a
Compare
e37d7fd to
b058b87
Compare
These are extension methods to the Crystal::EventLoop::Socket interface to enable support for evented OpenSSL::BIO for sockets with Kernel TLS enabled. Unlike the rest of the interface, these methods don't raise but instead return an Int32 | Errno union that must be acted upon by the caller.
0c8bd11 to
da2927c
Compare
Collaborator
Author
|
This is ready for review. |
Co-authored-by: Johannes Müller <straightshoota@gmail.com>
19bd9ca to
7fd1192
Compare
straight-shoota
approved these changes
Feb 26, 2026
Sija
reviewed
Feb 26, 2026
Collaborator
Author
|
Allright, there's something definitely wrong with MinGW + UCRT64 w.r.t OpenSSL. The std specs for both this PR and #16569 both fail with the same exit code (67) and no error message. They both are related to TLS. |
ysbaddaden
commented
Feb 26, 2026
| {% if flag?(:win32) && flag?(:gnu) && flag?(:x86_64) %} | ||
| # FIXME: why does the spec causes the process to die with status code 67? | ||
| pending! "process dies with exit code 67 on msys2-ucrt-x86_64 on CI" | ||
| {% end %} |
Collaborator
Author
There was a problem hiding this comment.
This isn't pretty, but it at least allows to move on until we can figure out the issue on this specific msys2 environment. I cherry-picked the same commit to #16569 where the issue is also fixed.
It might be related to raising exceptions in OpenSSL::BIO callbacks from C.
straight-shoota
approved these changes
Feb 26, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTES:
modprobe tls) ✔️sysctl kern.ipc.tls.enable=1) ✔️Draft PR because a number of independent PR shall be extracted (branched off #16640 + no flush on read + fix BIO init + classCrystal::BIOinstead of struct + Box, ...).Closes #16642.