1. 程式人生 > >基於源碼編譯openssl

基於源碼編譯openssl

source prefix con openssl oca spa article cal ble

  openssh依賴於openssl,由於ssl頻繁曝出漏洞,牽扯到openssh。而自身也存在漏洞。。。

00、下載openssl

https://www.openssl.org/source/

https://github.com/openssl/openssl/releases

https://www.openssl.org/source/openssl-1.0.2l.tar.gz

01、準備工作

yum -y install perl perl-devel gcc gcc-c++

02、編譯安裝

./config -fPIC --prefix=/usr/local/openssl enable-shared
make -j4

make install -j4
註釋:
--prefix:指定安裝目錄
-fPIC:編譯openssl的靜態庫
enable-shared:編譯動態庫 #在編譯openssh需要用道

03、替換文件

mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak

做軟鏈接

ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -sf /usr/local/openssl/include/openssl /usr/include/openssl

echo ‘/usr/local/openssl/lib‘ >> /etc/ld.so.conf
加載共享庫
ldd /usr/local/openssl/bin/openssl
ldconfig -v
#版本查看
openssl version -a

引用:

https://yq.aliyun.com/articles/66210

基於源碼編譯openssl