Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze libcurl

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to analyze libcurl, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

1. Libcurl introduction

Libcurl is a free, easy-to-use client transport library that supports DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP and other protocols. Libcurl supports SSL authentication, HTTP POST, HTTP PUT, FTP upload, HTTP form based upload, proxies, cookies, user name + password authentication (Basic, Digest, NTLM, Negotiate, Kerberos), file breakpoint resume, http agent forwarding.

Compared with the Boost asio network library, it has the following advantages

1) the setting of timeout is simple.

2) the summary authentication of HTTP has been realized.

3) HTTPS supports very well

4) HTTP interaction is implemented very well.

two。 Compile static library

Download the curl-7.61.0 source compression package, after decompression, enter projects\ Windows to have various versions of the VS solution, currently using VS2015, enter the VC14 folder, which contains a lib folder, which contains a libcurl solution and an existing libcurl project (the project will be added to the actual solution). The src folder contains a series of tool generation scenarios. By default, all supported protocols are compiled into the static library. Define HTTP_ONLY through macros and compile only HTTP,HTTPS into static libraries

3.HTTPS support

The curl-7.32.0 (2013-08-12 00:17) version does not support HTTPS, so you need to upgrade to the curl-7.61.0 (2018-07-11 08:01) version.

Currently, when developing HTTPS, a CURLE_UNSUPPORTED_PROTOCOL error is returned after the execution of the curl_easy_perform function.

The SSL code protocol used is curl_easy_setopt (hnd, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2)

A little knowledge

The curl command line relies on the openssl library to use ssl and TLS. At present, it is generally believed that TLSv1.1 and TLSv1.2 are secure. Many https servers only support these two protocols, but no longer support TLSv1.0 and ssl. But openssl only supports TLSv1.1 and TLSv1.2 from 1.0.1.

When only the following SSL-defined macros appear in the code

Enum {

CURL_SSLVERSION_DEFAULT

CURL_SSLVERSION_TLSv1

CURL_SSLVERSION_SSLv2

CURL_SSLVERSION_SSLv3

CURL_SSLVERSION_LAST / * never use, keep last * /

}

It indicates that this version does not support HTTPS protocol and needs to upgrade the curl version.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report