On my macOS environment,
which openssl returns the system openssl (/usr/bin/openssl),
while Net::SSLeay is linked to homebrew's openssl (/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib).
So instead of showing the version of openssl binary,
why don't you show Net::SSLeay::OPENSSL_VERSION_NUMBER() ?
use Net::SSLeay;
my $version = Net::SSLeay::OPENSSL_VERSION_NUMBER();
printf "0x%08x\n", $version; # eg: 0x30100010
Thanks, @skaji! I've added more diagnostics based on your feedback. I figured it's ok to leave the version about system openssl in as it may be helpful to have more info rather than less.
On my macOS environment,
which openssl
returns the system openssl (/usr/bin/openssl), whileNet::SSLeay
is linked to homebrew's openssl (/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib).So instead of showing the version of
openssl
binary, why don't you showNet::SSLeay::OPENSSL_VERSION_NUMBER()
?