2017- 04- 0810:17:24 Comment 532℃ heat
Due to business needs, the curl version on the server is too old and has loopholes, so I took some time to upgrade to the latest version to ensure the safety of communication between servers. Then I read some tutorials online and found that they are different. Finally, I found the easiest and most convenient one The method, share with everyone.
1. View current version##
The default curl version on Centos6.8 is 7.19.7, and the latest one is 7.53.1. This version is too old and too old..., hurry up and enter curl --version on the server to display the current version:
- curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
- Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
- Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
2. Upgrade curl
Use city-fan's update source to update here.
2.1. Update ca-bundle
- cp /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt.bak
- curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt
2.2 Added repo source###
- vim /etc/yum.repos.d/city-fan-for-curl.repo
Centos6 is edited as follows:
- [ CityFanforCurl]
- name=City Fan Repo
- baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/
- enabled=0
- gpgcheck=0
Centos7 is edited as follows:
- [ CityFanforCurl]
- name=City Fan Repo
- baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/
- enabled=0
- gpgcheck=0
2.3 Update curl
Use the following command to update directly:
- yum update curl --enablerepo=CityFanforCurl -y
2.4 Restart service###
After the update is complete, it is recommended to restart. It can be used normally.
- lnmp php-fpm restart
Enter curl --version again at this time:
- curl 7.53.1 (x86_64-redhat-linux-gnu) libcurl/7.53.1 OpenSSL/1.0.1e zlib/1.2.3 c-ares/1.12.0 libssh2/1.8.0 nghttp2/1.6.0
- Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
- Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy Metalink
3. problem##
One server has no problem following this step, and the other one encounters a problem and reports an error, which is probably the mirror source error and the CA certificate problem:
- http://mirror.math.princeton.edu/pub/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
- Trying other mirror.
- http://mirrors.mit.edu/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
- Trying other mirror.
- http://mirror.metrocast.net/fedora/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
- Trying other mirror.
- http://mirror.mrjester.net/fedora/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
- Trying other mirror.
- http://fedora-epel.mirror.lstn.net/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
- Trying other mirror.
- https://dl.fedoraproject.org/pub/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 77 - "Problem with the SSL CA cert (path? access rights?)"
So execute the command, and then continue to execute from 2.3.
- cp /etc/pki/tls/certs/ca-bundle.crt.bak /etc/pki/tls/certs/ca-bundle.crt
A more coincidental thing, the friend chain just added yesterday, the search problem happened to be encountered today?.
Reference link: https://www.htcp.net/337.html