Why the Download fails from one PC but not from my other PC'

Just starting out? Need help? Post your questions and find answers here.
stmdbe2019
User
User
Posts: 89
Joined: Mon Aug 31, 2009 2:11 pm

Why the Download fails from one PC but not from my other PC'

Post by stmdbe2019 »

Why the Download fails from one PC but not from my other PC's?

Code: Select all

InitNetwork()
              If ReceiveHTTPFile("https://myhttps.example.com/getjpeg?id=1","C:\exe\1212.jpg")
                PrintN (" #### DOWNLOAD >>>> : "  ) 
              Else
                PrintN (" #### FAIL FAIL FAIL ---- DOWNLOAD " ) 
              EndIf
The file is a simple JPG file, which works on other machine but not working on one machine. Firewall has only HTTPS allowed on that PC, External router.

EDIT: In server log i see when it is fail by ReceiveHTTPFile, it is because of following error. how to resolve it?

192.168.100.2:54679 [14/Oct/2019:03:49:00.374] lb/1: SSL handshake failure
-----
Registered PureBasic Coder.
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Why the Download fails from one PC but not from my other

Post by infratec »

DNS problem?
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Why the Download fails from one PC but not from my other

Post by #NULL »

Maybe 'other' pc doesn't have an exe directory on C: ?
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Why the Download fails from one PC but not from my other

Post by NicTheQuick »

Normally you not allowed to store anything directly on C:\ except you are an administrator. Better use the user directory for such things.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Why the Download fails from one PC but not from my other

Post by Marc56us »

Why the Download fails from one PC but not from my other PC's?
EDIT: In server log i see when it is fail by ReceiveHTTPFile, it is because of following error. how to resolve it?
192.168.100.2:54679 [14/Oct/2019:03:49:00.374] lb/1: SSL handshake failure
The PC does not have certificate or have wrong or expired certificate ?
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: Why the Download fails from one PC but not from my other

Post by firace »

Marc56us wrote:
Why the Download fails from one PC but not from my other PC's?
EDIT: In server log i see when it is fail by ReceiveHTTPFile, it is because of following error. how to resolve it?
192.168.100.2:54679 [14/Oct/2019:03:49:00.374] lb/1: SSL handshake failure
The PC does not have certificate or have wrong or expired certificate ?
Yes, looks like it. You could try to open that URL in IE on that PC and see what kind of error you get.
User avatar
kenmo
Addict
Addict
Posts: 1967
Joined: Tue Dec 23, 2003 3:54 am

Re: Why the Download fails from one PC but not from my other

Post by kenmo »

In general, try downloading to a "safe" folder like GetHomeDirectory() or GetTemporaryDirectory(), for testing.

If it's an HTTPS issue, is it failing on an older system? But works on a newer system?

I've had cases where HTTPS downloads fail on Windows XP accessing modern HTTPS servers. I could never solve it, so I resorted to calling wget.exe behind the scenes instead...
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Why the Download fails from one PC but not from my other

Post by NicTheQuick »

Of course WinXP will fail on many servers today. It's because it is fucking old and should be deleted immediately!

I configure my servers always to only use the latest recommended SSL settings mentioned here: https://cipherli.st/
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
stmdbe2019
User
User
Posts: 89
Joined: Mon Aug 31, 2009 2:11 pm

Re: Why the Download fails from one PC but not from my other

Post by stmdbe2019 »

Dear PureBasic Experts,

Only this following settings allowed me to make my code work:

Image

Code: Select all

InitNetwork()
              If ReceiveHTTPFile("https://myhttps.example.com/getjpeg?id=1","C:\exe\1212.jpg")
                PrintN (" #### DOWNLOAD >>>> : "  )
              Else
                PrintN (" #### FAIL FAIL FAIL ---- DOWNLOAD " )
              EndIf
Without those above windows settings, it was mission impossible to make it work.

Can anyone please advise why the hell only by doing those settings in windows 10 pro, it allowed purebasic ReceiveHTTPFile to work? (it was not file permission issue).

My server with curl i verified what TLS v1.2 , following encryption was used.

Code: Select all

$ curl https://me.me.me.me.com -v
* Rebuilt URL to: https://me.me.me.me.com
*   Trying https://me.me.me.me.com...
* TCP_NODELAY set
* Connected to https://me.me.me.me.com (https://me.me.me.me.com) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
But i am still confused what those windows checkbox did which fixed and allowed the code to work? How can we identify them quickly in PureBasic? (to avoid wasting 2 weeks which i lost on this)

Thanks guys!!!
-----
Registered PureBasic Coder.
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Why the Download fails from one PC but not from my other

Post by NicTheQuick »

What were the settings before? I don't have Windows 10 here.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
stmdbe2019
User
User
Posts: 89
Joined: Mon Aug 31, 2009 2:11 pm

Re: Why the Download fails from one PC but not from my other

Post by stmdbe2019 »

@NicTheQuick: On Windows 10 Pro. See the red lines those checkboxes on remove, the PureBasic Method works only. Please try to dig into it and share, what is the solution? so that it works without those default changes?

Image
-----
Registered PureBasic Coder.
Post Reply