Page 1 of 1
ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Thu Apr 11, 2024 9:52 pm
by arma
Hello everybody;
I need help please.
This is the code below.
Code: Select all
*Buffer = ReceiveHTTPMemory("https://www.armacomputer.com.tr/downloads/PRG/arma.SOFT/versions")
If *Buffer
Size = MemorySize(*Buffer)
Debug "Content: " + PeekS(*Buffer, Size, #PB_UTF8|#PB_ByteLength)
FreeMemory(*Buffer)
Else
Debug "Failed"
EndIf
This code works on Linux, Windows 10 etc. But doest work on Windows 7. Result is "Failed" on Wİndows 7. Is there any solution for this code works on Windows 7 or not?
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Fri Apr 12, 2024 7:30 am
by chi
Fails here on Win7 too... But when I replace the first line with "*Buffer = ReceiveHTTPMemory("
https://vaughn.live/browse/misc")" it works. So I guess the problem is with your server

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Fri Apr 12, 2024 10:09 am
by arma
Thanks for your answer.
Yes i noticed. that before.. This code works with some server on Windows 7. But the same always work on Windows 10 or Linux etc.
I want to fix if possible on Windows 7 work as the others.
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Fri Apr 12, 2024 11:15 am
by PBJim
Perhaps Windows 7 is treating something in the data as a redirection, since it contains so much that almost seems like a URL. I would try adding the below switch just to see.
#PB_HTTP_NoRedirect
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Sat Apr 13, 2024 6:19 pm
by arma
Thank you for your kind answer... But that doesnt work either

I did find other way for windows 7. curl.exe. But i am still looking for other solution if possible.
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Sat Apr 13, 2024 6:35 pm
by PBJim
arma wrote: Sat Apr 13, 2024 6:19 pm
Thank you for your kind answer... But that doesnt work either

I did find other way for windows 7. curl.exe. But i am still looking for other solution if possible.
There's a certificate error. I just tried with wget on our Linux server. Due to Windows 7's age, it might be related, the same as we often see with Let's Encrypt etc.
wget
www.armacomputer.com.tr/downloads/PRG/a ... T/versions
[…]
ERROR: cannot verify www.armacomputer.com.tr's certificate, issued by â/C=US/O=Let's Encrypt/CN=R3â:
Unable to locally verify the issuer's authority.
To connect to
www.armacomputer.com.tr insecurely, use `--no-check-certificate'.
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Sun Apr 14, 2024 5:42 am
by idle
have you tried HTTPRequestMemory instead with #PB_HTTP_WeakSSL or #PB_HTTP_NoSSLCheck
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Thu Apr 18, 2024 6:02 pm
by arma
Thank you for your nice answers...
I found my own method. curl.exe. I call durl.exe and use this.
Thank you again.
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Thu Apr 18, 2024 6:53 pm
by infratec
PureBasic is using libcurl
But if you want to do it yourself, use my libcurl.pbi and test HTTPRequestI()
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Thu Apr 18, 2024 7:13 pm
by PBJim
infratec wrote: Thu Apr 18, 2024 6:53 pm
PureBasic is using libcurl
I had been thinking exactly the same thing. An incompatibility between libcurl and Windows 7 maybe? I don't know

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Thu Apr 18, 2024 8:11 pm
by jassing
infratec wrote: Thu Apr 18, 2024 6:53 pm
PureBasic is using libcurl
But if you want to do it yourself, use my libcurl.pbi and test HTTPRequestI()
I tried it when searching for ideas/solutions... a bunch of missing imports. I gave up quickly since the files were so old, and PB has a way of breaking backwards compatibility if not kept up...
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Fri Apr 19, 2024 7:05 am
by infratec
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Thu Apr 25, 2024 8:22 am
by jassing
Ah, thanks. I had a wrong post ...
I ran it - I get a "SSL connect error" message from the code
Code: Select all
*HTTPRequest\Result = curl_easy_perform(*HTTPRequest\curl)
If *HTTPRequest\Result <> #CURLE_OK
Debug curl_easy_strerror(*HTTPRequest\Result)
EndIf
(Yes, I used #PB_HTTP_NoSSLCheck)
Wonder why the browsers can fetch this page, but nothing else... Curious indeed.
thanks for the help... I guess I shall stick with shelling to wget.exe (which, I specify no parameters & it handles the ssl certificate ok, just like the browsers)
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Thu Apr 25, 2024 8:49 am
by infratec
This has nothing to do with the certificate.
Windows 7 itself can not handle TLS 1.3
"Windows 7 doesn't support TLS1.3, end-of. (...)
So you need an external solution.
Unfortunaley the PB inbuild libcurl uses the system ssl stuff. -> you fail.
If you are using my HTTPRequestI, you can set
Before the include of HTTPReuestI.pbi. (At top of the program

)
Then you need the libcurl dll out of the zip file beside your executable.
If you are running from the IDE be sure to set 'create temporary exectuable in source directory', then you can place the dll in the sam edirectory.
This dll uses its own ssl with TLS 1.3 included.
Re: ReceiveHTTP doesnt work on Windows 7. Any solution?
Posted: Thu Apr 25, 2024 8:58 am
by jassing
infratec wrote: Thu Apr 25, 2024 8:49 am
Before the include of HTTPReuestI.pbi. (At top of the program

)
Brilliant! I was not including this soon enough. Those pesky details
Thanks!!! that was it!