ReceiveHTTP doesnt work on Windows 7. Any solution?

Just starting out? Need help? Post your questions and find answers here.
arma
User
User
Posts: 67
Joined: Sun Jul 24, 2016 11:54 pm

ReceiveHTTP doesnt work on Windows 7. Any solution?

Post 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?
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post 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 ;)
Et cetera is my worst enemy
arma
User
User
Posts: 67
Joined: Sun Jul 24, 2016 11:54 pm

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post 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.
PBJim
Enthusiast
Enthusiast
Posts: 296
Joined: Fri Jan 19, 2024 11:56 pm

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post 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
arma
User
User
Posts: 67
Joined: Sun Jul 24, 2016 11:54 pm

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post 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.
PBJim
Enthusiast
Enthusiast
Posts: 296
Joined: Fri Jan 19, 2024 11:56 pm

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post 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'.
User avatar
idle
Always Here
Always Here
Posts: 5967
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post by idle »

have you tried HTTPRequestMemory instead with #PB_HTTP_WeakSSL or #PB_HTTP_NoSSLCheck
arma
User
User
Posts: 67
Joined: Sun Jul 24, 2016 11:54 pm

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post 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.
infratec
Always Here
Always Here
Posts: 7654
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post by infratec »

PureBasic is using libcurl :wink:

But if you want to do it yourself, use my libcurl.pbi and test HTTPRequestI()
PBJim
Enthusiast
Enthusiast
Posts: 296
Joined: Fri Jan 19, 2024 11:56 pm

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post by PBJim »

infratec wrote: Thu Apr 18, 2024 6:53 pm PureBasic is using libcurl :wink:
I had been thinking exactly the same thing. An incompatibility between libcurl and Windows 7 maybe? I don't know :D
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post by jassing »

infratec wrote: Thu Apr 18, 2024 6:53 pm PureBasic is using libcurl :wink:

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...
infratec
Always Here
Always Here
Posts: 7654
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post by infratec »

jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post 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)
infratec
Always Here
Always Here
Posts: 7654
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post 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

Code: Select all

#LibCurl_ExternalDLL = #True
Before the include of HTTPReuestI.pbi. (At top of the program :wink: )
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.
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: ReceiveHTTP doesnt work on Windows 7. Any solution?

Post by jassing »

infratec wrote: Thu Apr 25, 2024 8:49 am

Code: Select all

#LibCurl_ExternalDLL = #True
Before the include of HTTPReuestI.pbi. (At top of the program :wink: )
Brilliant! I was not including this soon enough. Those pesky details ;-)

Thanks!!! that was it!
Post Reply