About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Download class
Author Message
Houge Offline
Silver Supporter

Post: #1
Download class
Hi,

I'm trying to use Download class for my custom REST server, but all I get is DWNL_ERROR state. I believe that's because Download does not want to work with "http://localhost" address and it is forced to use 80 port on HTTP and 443 on HTTPS.

It resolves addresses by using GetHostAddresses() function, if I specify public IP address (like google address 172.217.8.14) it works correctly, but it fails when using "127.0.0.1" or "localhost".

So what can I do if I want to test Download on localhost and with the use of different port (like 8000)?

P.S. I tried to edit "C:\Windows\System32\drivers\etc\hosts" file (Win10), but nothing changed
(This post was last modified: 09-22-2018 03:14 AM by Houge.)
09-22-2018 03:07 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Download class
Hi,

I think this commit should fix the problem:
https://github.com/Esenthel/EsenthelEngi...d9edb93e73
09-22-2018 10:44 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #3
RE: Download class
HTTP now works thanks, but HTTPS is still not.
Previous time the error was at DWNL_CONNECTING state, now is at DWNL_AUTH. Can it be a problem that I use self-signed (not trusted) certificate?

EDIT1:
Looks like _socket.handshake() is called and it returns something like MBEDTLS_X509_BADCERT_NOT_TRUSTED or MBEDTLS_X509_BADCRL_NOT_TRUSTED (https://tls.mbed.org/api/x509_8h.html)
Can you please add something like flag "ignore certificate trust" in SecureSocket.handshake to use it in Download class?
(This post was last modified: 09-22-2018 08:27 PM by Houge.)
09-22-2018 04:19 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Download class
09-23-2018 12:45 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #5
RE: Download class
Wow, awesome! Everything works now, thank you so much!
09-23-2018 02:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply