curl 的拓展 ssl 版本从默认的 nss 转为 openssl

2022/4/20 curlsslcentos

# 1. Reference

PHP-把curl扩展的SSL版本从NSS改为OpenSSL (opens new window)

centos6.5 64位ssl_version 是 NSS,不是openssl (opens new window)

# 2. 概述

Centos6.5 默认安装的 curl 使用的 ssl 版本是 NSS(Network Security Services) ,将其改为 OpenSSL

# 3. 步骤

检查 curl 版本

curl -V
## or
curl --version
1
2
3

安装依赖

yum -y install openssl openssl-devel
1

官方下载 curlIndex of /download/archeology (opens new window)

编译安装

tar zxvf curl--..

cd curl...

./configure --prefix=/usr --without-nss --with-ssl

make && make install

ldconfig

echo "/usr/local/lib" >> /etc/ld.so.conf && ldconfig
1
2
3
4
5
6
7
8
9
10
11

检查并重启服务

curl -V
service php-fpm restart
service nginx restart
1
2
3

# 4. 其他

# curl: (35) SSL connect error 报错

解决:升级 NSS

yum -y update nss
1
Last Updated: 2022/4/21 下午7:22:26