Page 1 of 1

Does anyone have an HTTPS server running?

Posted: Mon Nov 06, 2017 2:27 am
by blubb
I mean, in a usable state, i.e. one can access html pages that load images, css, js and so on? I have no problems at all with a HTTP server (based on the esp-link project), but HTTPS is a real pain. As long as I make one access at a time, there seems to be no problem. But accessing twice with too short a delay in between results in some kind of freeze. There is no exception, no error message*, but the server won't respond until reboot. Which is annoying, of course.



* besides the usual

server's data invalid protocol
Reason:[-0x7880]

that happens all the time.

Re: Does anyone have an HTTPS server running?

Posted: Mon Nov 06, 2017 2:01 pm
by Her Mary
I have some simple examples, not sure if it can help. I have added it as the attachment.

Re: Does anyone have an HTTPS server running?

Posted: Mon Nov 06, 2017 10:18 pm
by blubb
Hi,

thanks. That is indeed a very simple demo. I am going to test if the same problem occurs.
Is that the standard mbedtls and lwip that is also included in the SDK (as lib) or did you make some modifications?

Re: Does anyone have an HTTPS server running?

Posted: Tue Nov 07, 2017 7:36 am
by blubb
Ok, using the code you provided and the mbedtls lib from the current SDK (master branch) I get the same results: First it works. But after hitting F5 repeatedly in the browser the server hangs. Now I at least get error messages (I added the missing espconn_regist_reconcb):

Code: Select all

E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
E:M 1584
E:M 1584
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!
server handshake start.
E:M 1584
E:M 1584
E:M 1584
E:M 1584
E:M 1584
E:M 1584
server handshake failed!
Reason:[-0x 1]
reconnect callback, error code -1!


The server does not recover from this state. I have to reboot.

Can you please try if this happens for you, too?

Edit: I can even provoke an exception by hitting F5 fast enough. LoadProhibitedCause. According to map file it is somewhere in recv_tcp in libmbedtls.a

Edit: Exceptions can also be in tcp_recved or ringbuf_memcpy_into (both in liblwip.a).

Re: Does anyone have an HTTPS server running?

Posted: Thu Dec 14, 2017 6:59 pm
by ESP_Faye
Hi,

Please have a try with the ESP8266_NONOS_SDK commit a1fa90.

And add espconn_tcp_set_max_con(1); on your demo.

If your problem is still unsolved, please feel free to let us know.

Thanks.

Re: Does anyone have an HTTPS server running?

Posted: Thu Dec 14, 2017 8:00 pm
by blubb
The new SDK works when limited to only 1 connection, yes. Thanks. However, I gave up the endeavor since it does not work with standard browsers. They need more connections. There is too little heap in those tiny chips I'm afraid.