BASIC Developer & Support Resources > Scripting Languages

cURL Windows

<< < (3/9) > >>

I got it to compile remarking out the following.


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


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

The new version is 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.


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

--- Code: Script BASIC ---ch = curl::init()curl::option(ch, "URL", "")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.

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 challenge script. It seems things have changes since 7.5 and a it checks for a certificate before connecting to a HTTPS site.

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, "");        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.


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.


[0] Message Index

[#] Next page

[*] Previous page

Go to full version