Centos curl ssl 替换 NSS 为 OpenSSL

2023-05-16

参考:https://www.latoooo.com/xia_zhe_teng/368.htm

我的系统版本是 Centos 7 64位。
为了方便,先安装常用的开发环境。


yum groupinstall Development tools  

1.下载 OpenSSL:


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

2.解压 OpenSSL:


tar -xzvf openssl-1.0.2l.tar.gz  

3.进入 OpenSSL目录:


cd openssl-1.0.2l  

4.配置并编译 OpenSSL:


./config --shared 
make && make install
  

5.下载 curl 库:


wget https://curl.haxx.se/download/curl-7.55.1.tar.gz  

6.解压 curl 库:


tar -xzvf curl-7.55.1.tar.gz  

7.进入 curl 目录:


cd curl-7.55.1  

8.设置动态库路径:


export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/ssl/lib  

9.配置并编译 curl:


./configure --prefix=/usr/local/curl/ --without-nss --with-ssl=/usr/local/ssl/
make && make install
  

10.备份默认的 curl 二进制文件


mv /usr/bin/curl /usr/bin/curl.bak  

11.做一个新的 curl 软链


ln -s /usr/local/curl/bin/curl /usr/bin/curl  

总体的替换到此就完成,可以执行 curl --version 来进行确认。下边是我执行的结果:


curl 7.55.1 (x86_64-pc-linux-gnu) libcurl/7.55.1 OpenSSL/1.0.2l
Release-Date: 2017-08-14
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy   

转载于:https://www.cnblogs.com/tangjiansheng/p/8376871.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Centos curl ssl 替换 NSS 为 OpenSSL 的相关文章

随机推荐