curl: (35) SSL connect error

linux 命令行curl 访问https出现如下error:

rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

curl: (35) SSL connect error
error: https://www.elrepo.org/RPM-GPG-KEY-elrepo.org: import read failed(2).

* Closing connection #0

* SSL connect error

curl: (35) SSL connect error

解决方法:

yum update -y nss curl libcurl ca-certificates

yum update -y nss curl libcurl ca-certificates

Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
^C–> Running transaction check
—> Package ca-certificates.noarch 0:2017.2.14-65.0.1.el6_9 will be updated
[root@10-13-72-98 vhost]# yum update -y nss curl libcurl ca-certificates

Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
–> Running transaction check
—> Package ca-certificates.noarch 0:2017.2.14-65.0.1.el6_9 will be updated
—> Package ca-certificates.noarch 0:2020.2.41-65.1.el6_10 will be an update
—> Package curl.x86_64 0:7.19.7-53.el6_9 will be updated
—> Package curl.x86_64 0:7.19.7-54.el6_10 will be an update
—> Package libcurl.x86_64 0:7.19.7-53.el6_9 will be updated
–> Processing Dependency: libcurl = 7.19.7-53.el6_9 for package: libcurl-devel-7.19.7-53.el6_9.x86_64
—> Package libcurl.x86_64 0:7.19.7-54.el6_10 will be an update
–> Running transaction check
—> Package libcurl-devel.x86_64 0:7.19.7-53.el6_9 will be updated
—> Package libcurl-devel.x86_64 0:7.19.7-54.el6_10 will be an update
–> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================

Package Arch Version Repository Size

Updating:
ca-certificates noarch 2020.2.41-65.1.el6_10 updates 908 k
curl x86_64 7.19.7-54.el6_10 updates 198 k
libcurl x86_64 7.19.7-54.el6_10 updates 170 k
Updating for dependencies:
libcurl-devel x86_64 7.19.7-54.el6_10 updates 247 k

Transaction Summary

Upgrade 4 Package(s)

Total download size: 1.5 M
Downloading Packages:
(1/4): ca-certificates-2020.2.41-65.1.el6_10.noarch.rpm | 908 kB 00:00
(2/4): curl-7.19.7-54.el6_10.x86_64.rpm | 198 kB 00:00
(3/4): libcurl-7.19.7-54.el6_10.x86_64.rpm | 170 kB 00:00

(4/4): libcurl-devel-7.19.7-54.el6_10.x86_64.rpm | 247 kB 00:00

Total 18 MB/s | 1.5 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : libcurl-7.19.7-54.el6_10.x86_64 1/8
Updating : curl-7.19.7-54.el6_10.x86_64 2/8
Updating : libcurl-devel-7.19.7-54.el6_10.x86_64 3/8
Updating : ca-certificates-2020.2.41-65.1.el6_10.noarch 4/8
Cleanup : libcurl-devel-7.19.7-53.el6_9.x86_64 5/8
Cleanup : curl-7.19.7-53.el6_9.x86_64 6/8
Cleanup : ca-certificates-2017.2.14-65.0.1.el6_9.noarch 7/8
Cleanup : libcurl-7.19.7-53.el6_9.x86_64 8/8
Verifying : curl-7.19.7-54.el6_10.x86_64 1/8
Verifying : libcurl-devel-7.19.7-54.el6_10.x86_64 2/8
Verifying : libcurl-7.19.7-54.el6_10.x86_64 3/8
Verifying : ca-certificates-2020.2.41-65.1.el6_10.noarch 4/8
Verifying : curl-7.19.7-53.el6_9.x86_64 5/8
Verifying : libcurl-devel-7.19.7-53.el6_9.x86_64 6/8
Verifying : libcurl-7.19.7-53.el6_9.x86_64 7/8
Verifying : ca-certificates-2017.2.14-65.0.1.el6_9.noarch 8/8

Updated:
ca-certificates.noarch 0:2020.2.41-65.1.el6_10 curl.x86_64 0:7.19.7-54.el6_10 libcurl.x86_64 0:7.19.7-54.el6_10

Dependency Updated:
libcurl-devel.x86_64 0:7.19.7-54.el6_10

Complete!