first, list the details of the installed openssl version(or other programs) by:
$ls -al /usr/local/Cellar/openssl*
/usr/local/Cellar/openssl:
total 0
drwxr-xr-x 3 mba staff 96 Nov 30 17:18 .
drwxrwxr-x 170 mba admin 5440 Apr 8 02:03 ..
drwxr-xr-x 13 mba staff 416 Nov 21 03:13 1.0.2t
/usr/local/Cellar/[email protected]:
total 0
drwxr-xr-x 4 mba staff 128 Apr 7 18:35 .
drwxrwxr-x 170 mba admin 5440 Apr 8 02:03 ..
drwxr-xr-x 14 mba staff 448 Oct 1 2019 1.1.1d
drwxr-xr-x 14 mba staff 448 Apr 7 18:35 1.1.1f
as above output, there are only one "right" versions "openssl" in my mac. then, switch to it:
$brew switch openssl 1.0.2t
Cleaning /usr/local/Cellar/openssl/1.0.2t
Opt link created for /usr/local/Cellar/openssl/1.0.2t