When curl is installed by default, only the HTTP protocol is supported and the HTTPS protocol is not supported.
You can first use curl-v to see which protocols are currently supported by Curl:
[Email protected]/]# curl-v
Curl 7.19.4 (X86_64-UNKNOWN-LINUX-GNU) libcurl/7.19.4 openssl/1.0.2k zlib/1.2.11
Protocols:tftp ftp telnet dict http file FTPs
You can see that the HTTPS protocol is not supported. If you use the Curl command to access HTTPS, you will get an error:
Protocol HTTPS not supported or disabled in Libcurl
If you need to have curl support for the HTTPS protocol, you need to install OpenSSL and make it effective in curl:
Download and install the OpenSSL package (you do not need to reinstall if it is installed):
wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
wget https://www.openssl.org/source/openssl-fips-2.0.14.tar.gz
Install Openssl-fips:
Tar xvf openssl-fips-2.0.14.tar.gz
CD Openssl-fips-2.0.14&&./config&&make&&make Install
Installing OpenSSL:
Tar xvf openssl-1.0.2k.tar.gz
./config shared--prefix=/usr/local/ssl&& make && make install
# Update LD
echo "/usr/local/ssl/lib" >>/etc/ld.so.conf
Ldconfig-v
# Configure the OpenSSL library
Cp/usr/local/ssl/lib/libssl.so.1.0.0/usr/lib64;cp/usr/local/ssl/lib/libcrypto.so.1.0.0/usr/lib64
chmod 555/usr/lib64/libssl.so.1.0.0;chmod 555/usr/lib64/libcrypto.so.1.0.0
Ln-s/usr/lib64/libcrypto.so.1.0.0/usr/lib64/libcrypto.so.10;ln-s/usr/lib64/libssl.so.1.0.0/usr/lib64/ libssl.so.10
Ln-s/usr/local/ssl/bin/openssl/usr/bin/openssl;ln-s/usr/local/ssl/include/openssl/usr/include/openssl
# View the OpenSSL version
OpenSSL version-a
OpenSSL 1.0.2k Jan2017
Built on:reproducible build, date unspecified
Platform:linux-x86_64
Options:bn (64,64) RC4 (16x,int) des (idx,cisc,16,int) idea (int) blowfish (IDX)
Recompile Curl
./configure–with-ssl=/usr/local/ssl
Make
Make install
See if curl already supports the HTTPS protocol:
Curl-v
Curl 7.19.4 (X86_64-UNKNOWN-LINUX-GNU) libcurl/7.19.4 openssl/1.0.2k zlib/1.2.11
Protocols:tftp ftp telnet dict http file HTTPS FTPs
You can see that the HTTPS protocol is already supported.
This article is from the "L.P.F" blog, make sure to keep this source http://liupengfang1015.blog.51cto.com/6627801/1945846
Curl does not support HTTPS (Protocol HTTPS not supported or disabled in Libcurl)