libcurl.pbi

Share your advanced PureBasic knowledge/code with the community.
flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

Re: libcurl.pbi

Post by flashbob »

Bisonte wrote: Fri Jul 19, 2024 10:04 pm On windows 7 ? There is no TLS 1.2+ so it cant work with actual servers ... Or am I wrong ?
If you install an appropriate MS update and edit the registry, SSL/TLS 1.2+ is no problem under Windows 7 (e.g. for Outlook).
If a separate library is used for SSL/TLS (e.g. LibCurl, LibSSL, Wolfssl ...), then the operating system does not matter...
You can also test this with LibSSL. It works under Win7, but is not so fast as LibCurl.

LibCurl offers the functionality for Pop3s, but it does not work under Win7 / Win10. This means that receiving an e-mail using
Pop3 can only be done unencrypted. And that is of course nonsense. So the current version of LibCurl is unusable for this purpose.
By the way, users also report this error on Linux.
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

If you use the external dll with inbuild OpenSSL, TLS 1.3 is not a problem.

Is the latest dll not working on Windows 7?

According to
https://curl.se/changes.html

WIndows 7 is listet for 7.69.0
And 8.5.0 requires WIndows XP or later
build: require Windows XP or newer
flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

Re: libcurl.pbi

Post by flashbob »

infratec wrote: Sat Jul 20, 2024 9:30 am If you use the external dll with inbuild OpenSSL, TLS 1.3 is not a problem.

Is the latest dll not working on Windows 7?

According to
https://curl.se/changes.html

WIndows 7 is listet for 7.69.0
And 8.5.0 requires WIndows XP or later
build: require Windows XP or newer
In general the library works (https, pop3...). But receiving messages via pop3s does not. Some users reported that the version 7.1 and /or 7.5.3 was still ok regarding pop3s but then problems occured again with another version. On page https://curl.se/changes.html you can see that there were also problems with v7.30. Unfortunately I can't test this, so I'm looking for old libraries...

I have already tested several versions of 8.x
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

Re: libcurl.pbi

Post by flashbob »

infratec wrote: Sun Jul 21, 2024 9:28 am https://curl.se/download/
I know the link, these are only the source files and not the compiled dlls. It would be easier if there was a web source with the compiled DLLS somewhere. So I think I have to install a compiler...

But before I I'll test OpenSSL/Libssl. There are already finished DLLs that work for the purpose (pop3s). And there is also a good example from HeXOR which runs fine in PB without blocking SSL and without certificate errors. Let's see..
User avatar
Tristano
Enthusiast
Enthusiast
Posts: 195
Joined: Thu Nov 26, 2015 6:52 pm
Location: Italy
Contact:

Could Add a License Deed on the Thread?

Post by Tristano »

infratec wrote: Wed Jun 12, 2024 8:45 am Have you really in each of your files a copyright text :?:

If I follow you, I have to copy the MIT text in each of the files.

How can you violate a license when there is none?

Maybe Fred should add in the impressum that each code provided by a user is MIT licensed.

I will add a feature request for this.
Hi infratec. Since I noticed that the updated Zip file containing the library bindings still doesn't mention a license I wanted to ask you an update on this.

I had started working on a libcurl binding myself, but when I realized the huge amount of work involved I started to look if there was already one, and came across your bindings, so it doesn't make sense to duplicate efforts if its possible to collaborate on the same goal.

If you don't feel comfortable inserting a copyright and license notice in each source file, you could just add a single license file to the project (i.e. Zip file), or even just post a license in the original place. As long as you make a public statement to the effect that you are willing to share your work under a FOSS license (e.g. MIT License) that would be enough.

The MIT License is really simple to create, you only need to add the Copyright year and your name to the MIT License template, as found here:

https://choosealicense.com/licenses/mit/



Failing that, I'm afraid that your library will have to be considered copyrighted material which can't be used in personal nor commercial project, especially in view of the present unmet requests for a FOSS license release, which seem to indicate that you might not want to share your work under a license.

Thanks, and keep up to the good work.
The PureBASIC Archives: FOSS Resources:
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Added a License.txt file
Mesa
Enthusiast
Enthusiast
Posts: 433
Joined: Fri Feb 24, 2012 10:19 am

Re: libcurl.pbi

Post by Mesa »

For information, the last curl.dll which working with windows XP is cURL 7.83.1, and works fine still in 2024.

See here https://www.purebasic.fr/english/viewto ... te#p609473
and here https://github.com/negrutiu/libcurl-devel/releases

M.
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

That's a good link.

The only 'bad' thing is, that you have more than one dll. You need also the openssl dlls.
Mesa
Enthusiast
Enthusiast
Posts: 433
Joined: Fri Feb 24, 2012 10:19 am

Re: libcurl.pbi

Post by Mesa »

The dll that i use has everything inside, like openssl,....
Look at here https://github.com/negrutiu/libcurl-dev ... /v2022.6.7

v2022.6.7
@negrutiu negrutiu released this 07 Jun 14:43
· 28 commits to master since this release
v2022.6.7
fd2b132
Changelog:

Update libcurl/7.83.1
Update openssl/1.1.1o
Update cacert.pem/2022-04-26

Release Notes:

Built with Visual Studio 2019 and mingw gcc/12.1.0-2

curl -V (openssl)

curl 7.83.1 (Windows) libcurl/7.83.1 OpenSSL/1.1.1o zlib/1.2.12 nghttp2/1.47.0
Release-Date: 2022-05-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HSTS HTTP2 HTTPS-proxy IPv6 Largefile NTLM SSL TLS-SRP UnixSockets alt-svc libz

curl -V (winssl)

curl 7.83.1 (Windows) libcurl/7.83.1 Schannel zlib/1.2.12 nghttp2/1.47.0
Release-Date: 2022-05-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HSTS HTTP2 IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI TLS-SRP UnixSockets alt-svc libz

cacert.pem/2022-04-26
I use only 1 dll.

M.
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

If I want to use MSVC-curl_openssl-Release-Win32\bin\libcurl.dll
I have also to copy libssl-1_1.dll, libcrypto-1_1.dll
The ssl libs are not inside of libcurl.dll
Mesa
Enthusiast
Enthusiast
Posts: 433
Joined: Fri Feb 24, 2012 10:19 am

Re: libcurl.pbi

Post by Mesa »

Sorry but at the time when curl still supported Windows XP, there were two versions of the dll, a version without SSL (with the need to have two other dlls with it) and one with everything that Windows XP lacked don't have integrated ssl, all in a single dll. Trust me :wink:

M.
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

I trust you, no problem.
But I was unable to find this dll in your provided link.
Please tell me the loaction of it.
flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

Re: libcurl.pbi

Post by flashbob »

@ Tristano

You're basically right, but in this case I don't really understand the licensing confusion. The LibCurl library (dll) cannot be licensed again because it is an external open source project and a license already exists.
see https://curl.se/docs/copyright.html

The libcurl examples (see manual) are also described on several websites and can be used by anyone:
- https://curl.se/libcurl/c/example.html
- https://stackoverflow.com/questions/198 ... ng-libcurl
- https://www.autoitscript.com/forum/topi ... 4-support/
- https://everything.curl.dev/examples/get.html

Sure, the existing examples provided by libcurl have to be adapted to the respective language (basic, delphi, autoit,...) , but basically the examples are already available on many website (see above). That would be like translating a book into another language and registering myself as the author... and there isn't really much difference between the original example on the Curl website and the basic example in pop3.pbi from infratec or others. Example:

Original code from curl website written in C:

Code: Select all

 ...
  CURL *curl;
  CURLcode res = CURLE_OK;
 
  curl = curl_easy_init();
  if(curl) {
    /* Set username and password */
    curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
    curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
 
    curl_easy_setopt(curl, CURLOPT_URL, "pop3s://pop.example.com/1");
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
 
    /* Perform the retr */
    res = curl_easy_perform(curl);
 
    /* Check for errors */
    if(res != CURLE_OK)
      fprintf(stderr, "curl_easy_perform() failed: %s\n",
              curl_easy_strerror(res));
 
    /* Always cleanup */
    curl_easy_cleanup(curl);
  }
  ...
In comparison, the adapted code from infratec for PureBasic

Code: Select all

...
  curl = curl_easy_init()
  If curl
    ; Set username And password
    curl_easy_setopt_str(curl, #CURLOPT_USERNAME, UserName$)
    curl_easy_setopt_str(curl, #CURLOPT_PASSWORD, Password$)

    curl_easy_setopt_str(curl, #CURLOPT_URL, "pop3s://" + Url$ + "/" + Str(MessageNumber))
    curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYPEER, 0)
    curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYHOST, 0)
    curl_easy_setopt(curl, #CURLOPT_VERBOSE, 0)

    curl_easy_setopt(curl, #CURLOPT_WRITEFUNCTION, @LibCurl_WriteFunction())
    curl_easy_setopt(curl, #CURLOPT_WRITEDATA, @userdata)
  
    ; Perform the retr
    res = curl_easy_perform(curl)

    If res = #CURLE_OK
      Message$ = userdata\String
    Else
      Debug "curl_easy_perform() failed: " + curl_easy_strerror(res)
    EndIf
    
    ; Always cleanup
    curl_easy_cleanup(curl)
  EndIf
  ...
So what I'm wondering is which source code exactly do you want to have licensed ?

Btw.: Apart from that, any code posted by one in the forum can be used by others. Otherwise you wouldn't publish it. This is also part of the terms and conditions in most dev forums...
flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

Re: libcurl.pbi

Post by flashbob »

@ infratec

Thanks again for the maintenance at this central point and the updates for new DLL versions or minor bugs.
Post Reply