libcurl

PHP 7.1: no cURL with HTTP/2

亡梦爱人 提交于 2019-12-12 04:03:29
问题 My question is not about finding out if a server supports HTTP/2 (they both do) but how to make sure PHP is utilizing HTTP/2 with the correct cURL settings for the most current PHP version in CentOS (built from Remi's repository). My own answer addresses some oddities concerning this. I've setup my CentOS 7 server to support HTTP/2 with the help of this fine guide: Setting up HTTP/2 on your web server So I've got the latest releases, compiled and installed them and all is working fine. Pages

if I write a https program with libcurl, which CA cert should I download?

浪子不回头ぞ 提交于 2019-12-12 02:54:53
问题 I write a program to verify this website: www.alipay.com which root CA cert should I download from VeriSign, Inc.? 回答1: You can use this one: https://knowledge.rapidssl.com/library/VERISIGN/ALL_OTHER/RapidSSL%20Intermediate/RapidSSL_CA_bundle.pem Or this one from mozilla: https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 回答2: The curl project itself provides the Mozilla bundle converted to PEM if you'd like that: http://curl.haxx.se/docs/caextract.html

Building libcurl library in Visual Studio 2008

巧了我就是萌 提交于 2019-12-12 02:48:22
问题 I am trying to build libcurl from its source code. I have tried almost everything that has been answered on any forum ever but no success. Can anyone please tell me how to do it? I found this question Building libcurl library in c++, Noob Question but the solution doesn't work for me then I found this guide http://curl.haxx.se/libcurl/c/Using-libcurl-with-SSH-support-in-Visual-Studio-2008.pdf I followed every step, things went smooth until the end of section 3.4 of document, when I try to

“_ERR_remove_thread_state” linker error on libcurl usage

半世苍凉 提交于 2019-12-12 02:38:55
问题 Got OpenSSL (Win32) here http://slproweb.com/products/Win32OpenSSL.html Downloaded and compiled libCURL wit following flags USE_SSLEAY; USE_OPENSSL; CURL_DISABLE_LDAP; Included headers and libs in my project ... and now i get this ugly error. 1>libcurl.lib(ssluse.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "_ERR_remove_thread_state". 1>C:\[...].exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise. I guess this should remind me of a missing lib, but i think there are none

Cookies not being saved in cURL C++, such a simple and clean code example won't work

折月煮酒 提交于 2019-12-12 02:33:17
问题 why isn't the cookies storing? the local website I made has a setcookie("test",time()); in PHP and it works in the browser normally, but in cURL it just won't work, I don't even know what to try anymore, this is the simplest I got by trimming the code, and still don't save the cookies in a file. it doesn't even create the file to save it (btw the windows has the permissions to add any file in the root since I'm moving and creating files all the time there), and Yes the site example set

Get cUrl to preemptively send Authorization header for DIGEST authentication in PHP

。_饼干妹妹 提交于 2019-12-12 01:32:37
问题 We have a PHP page (actually a WordPress plugin) which makes calls to a REST API with DIGEST authentication. The curl handle is created on a per request basis, given authorisation credentials and successfully authenticates. PROBLEM: Under the hood, Curl is sending two requests. The first fails with a 401 and a challenge, the second contains an Authorization header and succeeds (200) Upon subsequent API calls cUrl continues to send two requests. This seems inefficient, causing 2 x network

Curl in PHP, SSLV3 works in bash but not in libcurl

馋奶兔 提交于 2019-12-12 01:09:14
问题 This command works directly in bash: curl --sslv3 -k 'https://www.test_site.com/test/abc.do' It does not work in bash without both --sslv3 and -k I've been trying to replicate in PHP with the following code but I get no response at all. Not even an error. Would appreciate any advice. $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,"https://www.test_site.com/test/abc.do"); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSLVERSION, 3); $result = curl_exec (

How do I encode binary file data to ISO-8859-1 to attach to the body of an HTTP post message

时光怂恿深爱的人放手 提交于 2019-12-12 01:02:42
问题 I'm trying to convert the full string of bytes from a file opened in binary mode to a string encoded in the ISO-8859-1 character set. My understanding is that by converting to ISO-8859-1 all binary information from the file is retained which is why it is being converted to that format. Is this a valid statement? I'm working in C++ (Visual Studio 2017) building an executable to be used on the Windows platform. I'm not experienced in HTTP programming. I have prototype code written in PowerShell

how do i get ALL images form a remote server using php/cURL

别等时光非礼了梦想. 提交于 2019-12-11 23:51:56
问题 There are many examples on how to get a single image, but what is the PHP way of getting ALL images 回答1: Please read: http://curl.haxx.se/docs/faq.html#Can_I_do_recursive_fetches_with You can probably call wget through php and do something similar like this. wget -A png,jpeg,jpg -r http://www.yoursite.com & This will spawn an asynchronous operation and download all file endings listed with the -A option. 回答2: I found a webbot example in a book once. Sample code : http://www.schrenk.com

0xc0150002 Error when trying to run VC++ libcurl

我与影子孤独终老i 提交于 2019-12-11 23:33:53
问题 I am using Visual Studio Express 2013 on Windows 7 x64 Professional. I followed this thread to setup libCurl with my Visual C++ project. But I get the following error message when I try to run any program, even the simple.c program fails. The application was unable to start correctly (0xc0150002). Click OK to close the application. 回答1: I was able to fix this error by installing the Visual C++ redistributable 2013 package. I installed both the x64 and x86 packages. 来源: https://stackoverflow