BASIC Developer & Support Resources > Scripting Languages

cURL Windows

<< < (3/9) > >>

John:
I got it to compile remarking out the following.


--- Code: C ---besDLL_MAIN besSUB_PROCESS_START  INIT_MULTITHREAD  return 1;besEND besSUB_PROCESS_FINISH  FINISH_MULTITHREADbesEND 
Compile

--- Code: Bash ---C:\sbgcc\source\extensions\curl>mingw32-make -B -f Makefilegcc -w -D_WIN32 -DSTATIC_LINK=1 -m32 -c -o ..\..\bin\mod\obj\curl\s_interface.o interface.car -r ..\..\bin\mod\lib\curl.a ..\..\bin\mod\obj\curl\s_interface.ogcc -w -D_WIN32 -m32 -c -o ..\..\bin\mod\obj\curl\interface.o interface.cgcc -Wno-write-strings -static-libgcc -pipe -shared -w -s -O2 -m32 -Wl,--add-stdcall-alias,--output-def,"..\..\bin\mod\dll\curl_imp.def",--out-implib,"..\..\bin\mod\dll\curl_imp.a" -s -o ..\..\bin\mod\dll\curl.dll ..\..\bin\mod\obj\curl\interface.o -lm -lpthread -lcurl C:\sbgcc\source\extensions\curl> 
When I try to run the RSS challenge I get the following extension error I had with the old curl extension module I compiled. This error code isn't defined in the source. The error happens executing the curl::perform() function. Since it works with http URLs it has to be something unique to this version of libcurl.dll and SSL.


(0): error 0x0008113c:Extension specific error: %s


On a positive note the new curl extension module works with http URLs.

These gcc arguments didn't help.

-DUSE_WINDOWS_SSPI
-DUSE_SCHANNEL

I replace the new libcurl.dll that came in the distribution with the one I posted earlier and it works.  Version: 7.50.1.0

The new version is 7.78.0.0 and fails.

I compiled the new curl.dll extension module using the new includes and libcurl.a.

The new curl.exe works with the RSS challenge HTTPS URL.

John:
Success!

Adding the following curl options allowed the new libcurl.dll to work.


--- Code: Script BASIC ---ch = curl::init()curl::option(ch, "URL", "https://s.ch9.ms/Events/MIX/MIX11/RSS/mp4high")curl::option(ch, "SSL_VERIFYPEER")curl::option(ch, "CAINFO","C:\\ScriptBasic\\bin\\curl-ca-bundle.crt")rss = curl::perform(ch)curl::finish(ch) 
This problem of Windows not finding the certificate store may be due to when OpenVPN wiped out my Windows system path and I had to rebuild it from what info I could find on the web. I may be missing that path. (guess) Why the earlier version of the libcurl.dll works is a mystery to me. Outlook keeps asking me to verify my certificate but won't save it.

John:
I tried the new curl extension module on my older laptop running Windows 10 Pro. I use this laptop for testing and not development. It won't run unless I have he the new lines I added to the rss.sb challenge script. It seems things have changes since 7.5 and a it checks for a certificate before connecting to a HTTPS site.

AIR:
Something must be 'broken' on your side.

This works on both my Mac and my Linux server:


--- Code: C ---#include <curl/curl.h>#include <stdio.h>// #include <stdlib.h>#include <string.h> long write_data (char *content, long size, long nmemb, char *stream) {  strcat(stream,content);  return size*nmemb;}   int main(int argc, char **argv) {    char buffer[128000][10];    CURL    *curl;    CURLcode res;     curl_global_init(CURL_GLOBAL_DEFAULT);    curl = curl_easy_init();     if (curl) {        curl_easy_setopt(curl, CURLOPT_URL, "http://channel9.msdn.com/Events/MIX/MIX11/RSS/mp4high");        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);        curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);         res = curl_easy_perform(curl);         if(res != CURLE_OK) {            printf("\ncurl_easy_perform() failed: %s\n",curl_easy_strerror(res));        } else {            printf("%s\n", *buffer);        }     }     curl_easy_cleanup(curl);    curl_global_cleanup();    return 0;}
Note that I'm using the 'http' address as specified in the challenge.

"curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);" is what tells cURL to process redirects.

AIR.

John:
I didn't have any issues on Linux either. Windows cURL is causing the problem. Are you using the latest release of LIBCURL?

The URL in your last example is not the URL in the original post.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version