Author Topic: cURL Windows  (Read 860 times)

Offline AIR

  • BASIC Developer
  • Posts: 817
Re: cURL Windows
« Reply #15 on: August 17, 2021, 10:42:16 pm »
It's a Windows specific issue.  Just tried with latest binary build (7.78), same issue...

Offline John

  • Forum Support / SB Dev
  • Posts: 3114
    • ScriptBasic Open Source Project
Re: cURL Windows
« Reply #16 on: August 17, 2021, 10:53:12 pm »
Thanks AIR for the validation. At least there is a solution.

Offline AIR

  • BASIC Developer
  • Posts: 817
Re: cURL Windows
« Reply #17 on: August 18, 2021, 04:35:10 am »
The URL in your last example is not the URL in the original post.

Neither is yours.  ;D

Changed it in mine.

Offline AIR

  • BASIC Developer
  • Posts: 817
Re: cURL Windows
« Reply #18 on: August 18, 2021, 04:52:40 am »
cURL on Windows is stupid.  By default, it doesn't use the Windows Certificate Store.

Instead of passing the crt file, John, try this single flag instead to force it to use the Windows Certificate Store:

Code: C
  1.         curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS , CURLSSLOPT_NATIVE_CA);
  2.  

AIR.

Offline John

  • Forum Support / SB Dev
  • Posts: 3114
    • ScriptBasic Open Source Project
Re: cURL Windows
« Reply #19 on: August 18, 2021, 08:54:54 am »
Not sure if the SB curl ext. module has that option. Checking now.

It doesn't look like that option is available. I guess I'm stuck with passing the cert.
« Last Edit: August 18, 2021, 09:05:34 am by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3114
    • ScriptBasic Open Source Project
Re: cURL Windows
« Reply #20 on: August 18, 2021, 10:19:29 am »
An option would be to distribute the 7.5 LIBCURL.dll which works with HTTPS. I don't know if this a bug or how they have chosen to move forward?

Offline AIR

  • BASIC Developer
  • Posts: 817
Re: cURL Windows
« Reply #21 on: August 18, 2021, 11:06:15 am »
Another option would be to use the Windows Native SSL implementation instead of OpenSSL.

See attached archive which contains both static and dynamic libraries that I built a little while ago from the current released cURL source.

AIR.

Offline John

  • Forum Support / SB Dev
  • Posts: 3114
    • ScriptBasic Open Source Project
Re: cURL Windows
« Reply #22 on: August 18, 2021, 11:18:09 am »
Great!

I give this a try.

Offline John

  • Forum Support / SB Dev
  • Posts: 3114
    • ScriptBasic Open Source Project
Re: cURL Windows
« Reply #23 on: August 18, 2021, 12:07:44 pm »
Your libcurl.dll doesn't work and returns an extension module error. (my OPTIONS remarked)

It doesn't work even if I use the two cURL OPTIONS I added.

Offline AIR

  • BASIC Developer
  • Posts: 817
Re: cURL Windows
« Reply #24 on: August 18, 2021, 12:10:26 pm »
did you rebuild the module using the libs, or did you simply try to plug them in?

Offline John

  • Forum Support / SB Dev
  • Posts: 3114
    • ScriptBasic Open Source Project
Re: cURL Windows
« Reply #25 on: August 18, 2021, 12:13:21 pm »
I just copied your libcurl.dll into my BIN directory.

I'll try rebuilding the extension module with your code. Do I need to modify my Makefile?
« Last Edit: August 18, 2021, 12:34:08 pm by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3114
    • ScriptBasic Open Source Project
Re: cURL Windows
« Reply #26 on: August 18, 2021, 12:25:07 pm »
I rebuilt the SB curl.dll extension module using your libcurl.a and used your libcurl.dll. I get an ext. module error trying to use it.

Offline AIR

  • BASIC Developer
  • Posts: 817
Re: cURL Windows
« Reply #27 on: August 18, 2021, 12:55:17 pm »
They are both the same library, one static one dynamic.  Use one or the other.

Offline John

  • Forum Support / SB Dev
  • Posts: 3114
    • ScriptBasic Open Source Project
Re: cURL Windows
« Reply #28 on: August 18, 2021, 01:19:34 pm »
I tried your static and dynamic and neither work. I don't have libz.a either.

I'm going with the 7.5 LIBCURL.DLL that works with no additional options. If someone wants to use the latest libcurl.dll for some reason they can pass the cert.

Offline AIR

  • BASIC Developer
  • Posts: 817
Re: cURL Windows
« Reply #29 on: August 19, 2021, 06:42:58 am »
Thanks, John.

Would it be possible for you to clean up this topic by splitting off the posts that centered around cURL?

AIR.