Curl does not support HTTPS issues

Source: Internet
Author: User

By default, Libcurl does not support HTTPS, and if you use the HTTPS link, the error " Protocol HTTPS not supported or disabled in Libcurl" appears. To see if curl supports HTTPS, you can use the command:

Curl-v.

There are two ways that Curl uses https:

1. Set to No authentication certificate and host

Code = curl_easy_setopt (handle, Curlopt_ssl_verifypeer, 0L);

2. Set up an SSL discriminant certificate

Http://curl.haxx.se/ca/cacert.pem

I don't know how to use these two methods, so I have to use the stupidest way to reload Curl:

1. Download Curl-7.14.0.tar.gz compressed package, many online

2. Unzip: # TAR-ZXVF Curl-7.14.0.tar.gz

# CD curl-7.14.0

#./configure note here that the last message indicates 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  IDNs 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 encrypted security HTTP-based protocol, need to use OpenSSL static library, so need to support https 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, in this case join the directory where OpenSSL generated the library file, and use the command Ldconfig to flush the cache.

#./configure--prefix=/usr/local/curl--with-ssl=/usr/local/ssl, note the last piece of information

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  IDNs 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

Tip support for OpenSSL has been supported, 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

The hint already supports HTTPS.

Curl does not support HTTPS issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.