jnthn / p6-io-socket-async-ssl

Asynchronous TLS sockets in Raku
11 stars 19 forks source link

Incompatibility with openssl3 #66

Closed vrurg closed 2 years ago

vrurg commented 2 years ago

Encountered on macOS with MacPorts which installs openssl3 by default. But likely to be the same issue on other platforms.

According to ssl.h, SSL_get_peer_certificate is a macro, aliasing to SSL_get1_peer_certificate. Correspondingly, the module fails with:

    Cannot locate symbol 'SSL_get_peer_certificate' in native library 'libssl.dylib'

Adding is symbol('SSL_get1_peer_certificate') to the declaration of native routine fixes the problem. Apparently, the fix would not be backward compatible with openssl1x. Unfortunately, I can't currently come up with a quick solution to determine which particular OpenSSL version is loaded, therefore do not have a real fix to this.

jonathanstowe commented 2 years ago

Just leaving a note so someone else can find it: this will definitely happen after upgrading to Fedora 36. Updating the IO::Socket::Async::SSL to the latest version fixes.

bazzaar commented 1 year ago

I also just encountered this same "bug", after upgrading to openssl3 on OpenSuse 15.4. So Googling for

Cannot locate symbol 'SSL_get_peer_certificate' in native library 'libssl.so'

, landed me here. The issue info above and also in #67 is super helpful, thanks. The following fixed it for me :

zef install --force-install IO::Socket::Async::SSL