Will installation of macports automatically install or update OpenSSL?

Solution 1:

MacPorts will not replace your system-provided version of OpenSSL. If you install OpenSSL using MacPorts, it will do so in a separate prefix (by default /opt/local).

To check the version of the OpenSSL library, run /path/to/openssl version where /path/to/openssl is the path of the OpenSSL binary that corresponds to the library you want to check, e.g. /usr/bin/openssl for the system OpenSSL in /usr/lib/libssl.dylib and /opt/local/bin/openssl for the MacPorts OpenSSL in /opt/local/lib/libssl.dylib.

You can also check the OpenSSL library version directly using

$> strings /path/to/libssl.dylib | grep -E '^OpenSSL'

e.g. for MacPorts:

$> strings /opt/local/lib/libssl.dylib | grep -E '^OpenSSL'
OpenSSL 1.0.1i 6 Aug 2014

and for system OpenSSL:

$> strings /usr/lib/libssl.dylib | grep -E '^OpenSSL'
OpenSSL 0.9.8y 5 Feb 2013

Unfortunately OpenSSL has changed and those command don't work the ^ in the grep does not find the version so for Macports

strings /opt/local/lib/libssl.dylib | grep -E 'OpenSSL'

gives

!(29OpenSSL 1.1.1l  24 Aug 2021
OPENSSL_DIR_read(&ctx, '
OPENSSL_init_ssl

and the system library has moved in Big Sur and possibly earlier