It is currently Tue Oct 20, 2020 1:46 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Why the Download fails from one PC but not from my other PC'
PostPosted: Mon Oct 14, 2019 3:49 am 
Offline
User
User

Joined: Mon Aug 31, 2009 2:11 pm
Posts: 89
Why the Download fails from one PC but not from my other PC's?

Code:
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Mon Oct 14, 2019 6:39 am 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4961
Location: Germany
DNS problem?


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Mon Oct 14, 2019 7:43 am 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 1264
Location: right here
Maybe 'other' pc doesn't have an exe directory on C: ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Mon Oct 14, 2019 1:31 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 599
Location: Germany, Saarbrücken
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Mon Oct 14, 2019 1:40 pm 
Offline
Addict
Addict

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 940
Quote:
Why the Download fails from one PC but not from my other PC's?

Quote:
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 ?

_________________
(English is not my native language, I use an online translator.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Mon Oct 14, 2019 1:50 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 09, 2011 8:58 am
Posts: 613
Marc56us wrote:
Quote:
Why the Download fails from one PC but not from my other PC's?

Quote:
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.

_________________
My new project: A simple HTML/CSS UI engine for PB desktop apps
viewtopic.php?f=7&t=74582


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Mon Oct 14, 2019 2:33 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1850
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...

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Mon Oct 14, 2019 2:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 599
Location: Germany, Saarbrücken
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Mon Oct 14, 2019 11:23 pm 
Offline
User
User

Joined: Mon Aug 31, 2009 2:11 pm
Posts: 89
Dear PureBasic Experts,

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

Image

Code:
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:
$ 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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Tue Oct 15, 2019 9:03 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 599
Location: Germany, Saarbrücken
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Why the Download fails from one PC but not from my other
PostPosted: Wed Oct 16, 2019 6:35 pm 
Offline
User
User

Joined: Mon Aug 31, 2009 2:11 pm
Posts: 89
@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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 46 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye