MacOS中升级openssl

MacOS中升级openssl
 
➜  ~ brew instal openssl
使用情况中始终发现,openssl并没有真正升级
 
在/usr/local/Cellar/openssl/目录中发现已经存在最新版
➜  ~ ll  /usr/local/Cellar/openssl/
total 0
drwxr-xr-x 11 xxx admin 374  4 10 15:47 1.0.2g
drwxr-xr-x 11 xxx admin 374  5 17 17:03 1.0.2h
drwxr-xr-x 11 xxx admin 374  5 17 17:39 1.0.2h_1
➜  ~
但是which openssl显示如下。
/usr/bin/openssl
并没有使用刚安装的版本
 
所以索性创建软连接,按照习惯在/usr/local/bin/中创建软连接
➜  ~ ln -s /usr/local/Cellar/openssl/1.0.2h_1/bin/openssl /usr/local/bin/openssl
 
最后看一下版本,正常了。
➜  ~
➜  ~ openssl version -a
OpenSSL 1.0.2h  3 May 2016
built on: reproducible build, date unspecified
platform: darwin64-x86_64-cc
options:  bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: clang -I. -I.. -I../include  -fPIC -fno-common -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: "/usr/local/etc/openssl"
 
错误的版本是这个,默认已经不使用它了。暂时就让他留着吧。
➜  ~
➜  ~ /usr/bin/openssl version -a
OpenSSL 0.9.8zh 14 Jan 2016
built on: May 15 2016
platform: darwin64-x86_64-llvm
options:  bn(64,64) md2(int) rc4(ptr,char) des(idx,cisc,16,int) blowfish(idx)
compiler: -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O3 -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DMD32_REG_T=int -DOPENSSL_NO_IDEA -DOPENSSL_PIC -DOPENSSL_THREADS -DZLIB -mmacosx-version-min=10.6
OPENSSLDIR: "/System/Library/OpenSSL"
➜  ~
 
 
原文地址:https://www.cnblogs.com/vc60er/p/5851524.html