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

Replace lib version comparisons by functional feature checks #11374

Conversation

straight-shoota
Copy link
Member

We don't need to check the library version at the binding definition and call site again. Checking the availability of lib methods is easier and enables cross-library usability (libressl and openssl define the same functions).

This also fixes differences in the API of SSL::Context depending on the library version. Stdlib APIs must be consistent. Some methods that were missing when linking against older library versions now raise NotImplementedError at runtime.

We don't need to check the library version at the binding definition and
call site again. Checking the availability of lib methods is easier
and enables cross-library usability (libressl and openssl define the
same functions).

This also fixes differences in the API of SSL::Context depending on the
library version. Stdlib APIs must be consistent. Some methods that were
missing when linking against older library versions now raise
NotImplementedError at runtime.
@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:crypto kind:refactor labels Oct 27, 2021
@straight-shoota straight-shoota added this to the 1.3.0 milestone Oct 28, 2021
@straight-shoota straight-shoota merged commit 01a8544 into crystal-lang:master Oct 29, 2021
@straight-shoota straight-shoota deleted the refactor/lib-compare_versions branch October 29, 2021 22:01
@straight-shoota straight-shoota modified the milestones: 1.3.0, 1.2.2 Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. kind:refactor topic:stdlib:crypto
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants