Page 1 of 1
Why the Download fails from one PC but not from my other PC'
Posted: Mon Oct 14, 2019 3:49 am
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
Re: Why the Download fails from one PC but not from my other
Posted: Mon Oct 14, 2019 6:39 am
by infratec
DNS problem?
Re: Why the Download fails from one PC but not from my other
Posted: Mon Oct 14, 2019 7:43 am
by #NULL
Maybe 'other' pc doesn't have an exe directory on C: ?
Re: Why the Download fails from one PC but not from my other
Posted: Mon Oct 14, 2019 1:31 pm
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.
Re: Why the Download fails from one PC but not from my other
Posted: Mon Oct 14, 2019 1:40 pm
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 ?
Re: Why the Download fails from one PC but not from my other
Posted: Mon Oct 14, 2019 1:50 pm
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.
Re: Why the Download fails from one PC but not from my other
Posted: Mon Oct 14, 2019 2:33 pm
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...
Re: Why the Download fails from one PC but not from my other
Posted: Mon Oct 14, 2019 2:49 pm
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/
Re: Why the Download fails from one PC but not from my other
Posted: Mon Oct 14, 2019 11:23 pm
by stmdbe2019
Dear PureBasic Experts,
Only this following settings allowed me to make my code work:
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!!!
Re: Why the Download fails from one PC but not from my other
Posted: Tue Oct 15, 2019 9:03 am
by NicTheQuick
What were the settings before? I don't have Windows 10 here.
Re: Why the Download fails from one PC but not from my other
Posted: Wed Oct 16, 2019 6:35 pm
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?
