Closed straight-shoota closed 3 months ago
I did some digging around, and this is due to an extra field in a struct by libressl: https://github.com/libressl/openbsd/blob/9338f2e503bcf0185656636d62eec3005ed27254/src/lib/libcrypto/bio/bio_local.h#L79 Which is not reflected by the crystals definition in https://github.com/crystal-lang/crystal/blob/4ea385a2d3d67b14776ac8cd5cfb9b2d68f172b6/src/openssl/lib_crypto.cr#L56 and thus not set as initialized because all the offsets are wrong.
The current implementation seems hacky and prone to future regressions -- is it really necessary to have own definitions by crystal? Is the provided, exported ssl interface not enough?
I'm getting this exact same issue when building invidious on OpenBSD 7.5. It's using crystal. Is there any solution yet? It builds successfully on FreeBSD so I assume they aren't using libreSSL.
I have a branch that adds specs for testing the SSL bindings against libreSSL: https://github.com/crystal-lang/crystal/compare/master...straight-shoota:crystal:feature/ci-alpine-libressl-3.5
Lots of specs are failing (https://github.com/straight-shoota/crystal/actions/runs/3303496182/jobs/5451483965). Mostly with this error:
I have not found any details about this error message. But it looks like we might be missing some initialization.
LibreSSL 3.5 is the version provided in Alpine Linux 3.16 which our alpine docker images are based on. Using libreSSL in these images currently fails (by default, Alpine Linux uses OpenSSL, though; you'd need to switch to libreSSL explicitly).