By default, libcurl does not support HTTPS. If you use an HTTPS link"Protocol HTTPS not supported or disabled in libcurl"Error prompt. To check whether curl supports https, run the following command:
Curl-v.
Curl can be used in two ways:
1. Set to not verify the certificate and host
Code = curl_easy_setopt (handle, curlopt_ssl_verifypeer, 0l );
2. Set an SSL Certificate
Http://curl.haxx.se/ca/cacert.pem
You do not know how to use these two methods, so you have to use the most stupid method to reinstall curl:
1.download the curl-7.14.0.tar.gz compressed package. There are many
2. Unzip: # tar-zxvf curl-7.14.0.tar.gz
# Cdcurl-7.14.0
#./Configure note that a message is displayed at the end to indicate whether HTTPS is supported:
curl version: 7.14.0 Host setup: x86_64-unknown-linux-gnu Install prefix: /usr/local Compiler: gcc SSL support: no (--with-ssl / --with-gnutls) zlib support: enabled krb4 support: no (--with-krb4*) GSSAPI support: no (--with-gssapi) SPNEGO support: no (--with-spnego) c-ares support: no (--enable-ares) ipv6 support: enabled IDN support: enabled Build libcurl: Shared=yes, Static=yes Built-in manual: enabled Verbose errors: enabled (--disable-verbose) SSPI support: no (--enable-sspi) ca cert path: no
The SSL support prompt here is not supported, because the HTTPS protocol is an encrypted and secure HTTP-based protocol and the OpenSSL static library is required. To support https, you must download OpenSSL, here do not repeat, the method is visible: http://www.linuxidc.com/Linux/2011-01/31229.htm
# Vi/etc/lD. So. conf: add the directory where the library file generated by OpenSSL is located and use the command ldconfig to refresh the cache.
#./Configure -- prefix =/usr/local/curl -- With-SSL =/usr/local/SSL. Pay attention to the last section.
curl version: 7.14.0 Host setup: x86_64-unknown-linux-gnu Install prefix: /usr/local Compiler: gcc SSL support: enabled (OpenSSL) zlib support: enabled krb4 support: no (--with-krb4*) GSSAPI support: no (--with-gssapi) SPNEGO support: no (--with-spnego) c-ares support: no (--enable-ares) ipv6 support: enabled IDN support: enabled Build libcurl: Shared=yes, Static=yes Built-in manual: enabled Verbose errors: enabled (--disable-verbose) SSPI support: no (--enable-sspi) ca cert path: /usr/local/share/curl/curl-ca-bundle.crt
Prompt that OpenSSL is supported, and then make and make install.
# Curl-V
curl 7.14.0 (x86_64-unknown-linux-gnu) libcurl/7.14.0 OpenSSL/1.0.1e zlib/1.2.3 libidn/1.18Protocols: ftp gopher telnet dict ldap http file https ftps Features: IDN IPv6 Largefile NTLM SSL libz
It indicates that HTTPS is supported.