Based on: https://mebsd.com/freebsd-security-hardening/openssl-upgrade-freebsd.html
Update ports tree:
portsnap fetch update
(OPTIONAL) If the ports tree snapshot is corrupt you may need to rebuild it from scratch:
rm /var/db/portsnap/tag && rm -rf /var/db/portsnap/files && portsnap fetch extract
Edit /etc/make.conf
and add:
DEFAULT_VERSIONS+=ssl=openssl
(ALTERNATIVE) Older versions of FreeBSD may use:
WITH_OPENSSL_PORT=yes
In basic configuration this results in an /etc/make.conf
that looks like this:
WITH_PKGNG=yes
DEFAULT_VERSIONS+=ssl=openssl
(OPTIONAL) Install portupgrade
if it's not yet installed
cd /usr/ports/ports-mgmt/portupgrade
make install clean BATCH=yes; rehash
Install OpenSSL
portupgrade -N security/openssl
Rebuild all packages associated with OpenSSL
portupgrade -Rrf security/openssl